Skip to content

Instantly share code, notes, and snippets.

View LZL0's full-sized avatar
🌌

LZL0

🌌
  • Milky Way
View GitHub Profile
@LZL0
LZL0 / controls.sii
Last active January 26, 2023 00:52
American Truck Simulator Xbox One controller config
SiiNunit
{
input_config : _nameless.226.5bf4.f2e0 {
version: 24
config_lines: 533
config_lines[0]: "device keyboard `di8.keyboard`"
config_lines[1]: "device mouse `fusion.mouse`"
config_lines[2]: "device joy `di8.'{334F2060-831C-11ED-8001-444553540000}|{0B00045E-0000-0000-0000-504944564944}'`"
config_lines[3]: "device phys_mouse ``"
config_lines[4]: "device joy2 ``"
@LZL0
LZL0 / tailwind.config.js
Created January 14, 2023 00:48 — forked from lgladdy/tailwind.config.js
A tailwind plugin for generating WordPress block editor (Gutenberg) color css styles from the tailwind palette
const _ = require('lodash')
const plugin = require('tailwindcss/plugin')
plugins: [
plugin(function({ addComponents, theme }) {
const colors = theme('colors', {})
const exclude = ['transparent', 'current']
const paletteColors = []
for (const [key, value] of Object.entries(colors)) {
@LZL0
LZL0 / Using Github Deploy Key.md
Created January 10, 2022 02:13 — forked from zhujunsan/Using Github Deploy Key.md
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@LZL0
LZL0 / php speed up tips.html
Created September 27, 2020 14:42 — forked from bsalim/php speed up tips.html
63 Tips for speeding up PHP
<html>
<body>
<p>Here are Webber’s points:</p>
<ul>
<li>If a method can be static, declare it static. Speed improvement is by a factor of 4.</li>
<li>echo is faster than print.(<em>* compare with list from phplens by John Lim</em>)</li>
<li>Use echo’s multiple parameters instead of string concatenation.</li>
<li>Set the maxvalue for your for-loops before and not in the loop.</li>
<li>Unset your variables to free memory, especially large arrays.</li>
<li>Avoid magic like __get, __set, __autoload</li>
@LZL0
LZL0 / yoast-seo-sitemap.php
Created August 20, 2020 14:26 — forked from mohandere/yoast-seo-sitemap.php
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?php
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
// Add custom index
@LZL0
LZL0 / granny_shots_widget.php
Created June 18, 2020 16:35
Granny Shots Dashboard Widget
<?php
if(!(defined('ABSPATH'))) exit;
add_action('wp_dashboard_setup', 'fs_bps_dashboard_widget');
add_action('wp_dashboard_setup', 'fs_bps_dashboard_update_box_handle');
function fs_bps_dashboard_widget()
{
@LZL0
LZL0 / deploy-to-digital-ocean.markdown
Created February 28, 2020 00:22 — forked from montrealist/deploy-to-digital-ocean.markdown
How to deploy files to Digital Ocean when pushing to Gitlab

How to get auto-deploy working from Gitlab to your Digital Ocean (DO) server.

Install https://github.com/olipo186/Git-Auto-Deploy (via apt-get):

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:olipo186/git-auto-deploy
sudo apt-get update
sudo apt-get install git-auto-deploy
@LZL0
LZL0 / nginx device redirect
Created August 13, 2019 10:24 — forked from mariusom/nginx device redirect
Nginx detecting desktop, tablet or mobile by looking tat the http user agent.
# Source: http://detectmobilebrowsers.com/
set $mobile_rewrite do_not_perform;
if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") {
set $mobile_rewrite perform;
}
if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|t
@LZL0
LZL0 / my.cnf
Created May 9, 2019 22:42 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@LZL0
LZL0 / my.cnf
Created May 9, 2019 22:41 — forked from kanibaspinar/my.cnf
Mysql My.cnf Optimization - Best Performance For 1000 + Sites Web Server
# Optimized MySQL configuration for cPanel servers by Kani Baspinar - Updated June 2016
#
# The settings provided below are a starting point for a 24GB RAM server with 8 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# Test your configuration ; https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is NO comment beside a setting, then you don't need to adjust it.
#