Skip to content

Instantly share code, notes, and snippets.

View stevenliebregt's full-sized avatar

Steven Liebregt stevenliebregt

View GitHub Profile
@stevenliebregt
stevenliebregt / .htaccess
Created December 25, 2017 18:00
All in one .htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /
# Redirect Trailing Slashes...
@stevenliebregt
stevenliebregt / png_resizor.py
Created March 2, 2018 11:56
Resize images, edit to change folders and or sizes
#!/usr/bin/python3
import os
from PIL import Image
CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
INPUT_PATH = CURRENT_PATH + '/png'
OUTPUT_PATH = CURRENT_PATH + '/png_50'
TARGET_SIZE_X = 50
@stevenliebregt
stevenliebregt / ascii.txt
Created March 24, 2018 16:40
Funny Ascii Copy Paste chart
๑•ิ.•ั๑ ๑۩۞۩๑ ♬✿.。.:* ★ ☆ εїз℡❣·۰•●○●ōゃ ♥ ♡๑۩ﺴ ☜ ☞ ☎ ☏♡ ⊙◎ ☺ ☻✖╄ஐﻬ ► ◄ ▧ ▨ ♨ ◐ ◑ ↔ ↕ ▪ ▫ ☼ ♦ ▀ ▄ █▌ ▐░ ▒ ▬♦ ◊ ◦ ☼ ♠♣ ▣ ▤ ▥ ▦ ▩ ◘ ◙ ◈ ♫ ♬ ♪ ♩ ♭ ♪ の ☆ → あ ぃ £ ❤# @ & * ❁ ❀ ✿ ✾ ❃ ✺ ❇ ❈ ❊ ❉ ✱ ✲ ✩ ✫ ✬ ✭ ✮ ✰ ☆ ★ ✪ ¤ ☼ ☀ ☽ ☾ ❤ ♡ ღ☻ ☺ ❂ ◕ ⊕ ☉ Θ o O ♋ ☯ ㊝ ⊙ ◎◑ ◐ ۰ • ● ▪ ▫ 。 ゚ ๑ ☜ ☞ ☂ ♨ ☎ ☏ × ÷ = ≠ ≒ ∞ ˇ ± √ ⊥▶ ▷ ◀ ◁ ☀ ☁ ☂ ☃ ☄ ★ ☆ ☇ ☈ ☉ ☊ ☋ ☌ ☍ ☑ ☒☢ ☸ ☹ ☺ ☻ ☼ ☽ ☾ ♠ ♡ ♢ ♣ ♤ ♥ ♦ ♧ ♨ ♩ ✙ ✈ ✉ ✌ ✁♝ ♞♯♩♪♫♬♭♮ ☎ ☏ ☪ ♈ ♨ ₪ ™ ♂✿ ♥ の ↑ ↓ ← → ↖ ↗ ↙ ↘ ㊣ ◎ ○ ● ⊕ ⊙ ○  △ ▲ ☆ ★ ◇ ◆ ■ □ ▽ ▼ § ¥ 〒 ¢ £ ※ ♀ ♂ &⁂ ℡ ↂ░ ▣ ▤ ▥ ▦ ▧ ✐✌✍✡✓✔✕✖ ♂ ♀ ♥ ♡ ☜ ☞ ☎ ☏ ⊙ ◎ ☺ ☻ ► ◄ ▧ ▨ ♨ ◐ ◑ ↔ ↕ ♥ ♡ ▪ ▫ ☼ ♦ ▀ ▄ █ ▌ ▐ ░ ▒ ▬ ♦ ◊ ◘ ◙ ◦ ☼ ♠ ♣ ▣ ▤ ▥ ▦ ▩ ◘ ◙ ◈ ♫ ♬ ♪ ♩ ♭ ♪ ✄☪☣☢☠░ ▒ ▬ ♦ ◊ ◦ ♠ ♣ ▣ ۰•● ❤ ●•۰► ◄ ▧ ▨ ♨ ◐ ◑ ↔ ↕ ▪ ▫ ☼ ♦♧♡♂♀♠♣♥❤☜☞☎☏⊙◎ ☺☻☼▧▨♨◐◑↔↕▪ ▒ ◊◦▣▤▥ ▦▩◘ ◈◇♬♪♩♭♪の★☆→あぃ£Ю〓§♤♥▶¤๑⊹⊱⋛⋌⋚⊰⊹ ๑۩۩.. ..۩۩๑ ๑۩۞۩๑ ✲ ❈ ✿ ✲ ❈ ➹ ~.~ ◕‿- ❣ ✚ ✪ ✣ ✤ ✥ ✦❉ ❥ ❦ ❧ ❃ ❂ ❁ ❀ ✄ ☪ ☣ ☢ ☠ ☭ღღღ ▶ ▷ ◀ ◁ ☀ ☁ ☂ ☃ ☄ ★ ☆ ☇ ☈ ⊙ ☊ ☋ ☌ ☍ⓛⓞⓥⓔ๑•ิ.•ั๑ ๑۩۞۩๑ ♬✿ ☉♡ ♢ ♣ ♤ ♥ ♦ ♧ ♨ ♩ ✙✈ ✉ ✌ ✁ ✎ ✐ ❀ ✰ ❁ ❤ ❥ ❦❧ ➳ ➽ εїз℡❣·۰•●○●ゃōゃ♥ ♡๑۩ﺴ ☜ ☞ ☎ ☏♡ ⊙◎ ☺ ☻✖╄ஐﻬ ► ◄ ▧ ▨ ♨ ◐ ◑ ↔ ↕ ▪ ▫ ☼ ♦ ▀ ▄ █▌ ▐░ ▒ ▬♦ ◊ ◦
@stevenliebregt
stevenliebregt / areasizecalc.cpp
Created April 6, 2018 13:36
Image area size calculator using resolutions and screen size
/**
* Image area size calculator.
*
* This code can be used to calculate the area size of an image in squared centimeters.
*
* @author Steven Liebregt <stevenliebregt@outlook.com>
* @version 1.0.0
* @date 2018/04/06
*/
@stevenliebregt
stevenliebregt / php-debug-ini-header.php
Created May 17, 2018 20:16
PHP ini debug header so I won't forget the options.
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('error_reporting', '1');
ini_set('xdebug.var_display_max_depth', 10);
ini_set('xdebug.var_display_max_children', 256);
ini_set('xdebug.var_display_max_data', 1024);
@stevenliebregt
stevenliebregt / list-comma-and.php
Last active July 30, 2018 12:54
list, comma & and @ end
<?php
$list = [1, 2, 3, 4];
array_splice($list, -2, 2, implode(' and ', array_slice($list, -2)));
$text = implode(', ', $list);
echo $text; // This will print "1, 2, 3 and 4"
@stevenliebregt
stevenliebregt / switch-layout.sh
Created September 6, 2018 19:42
Switch XKB map `intl` layouts
# To switch to `intl`
setxkbmap -layout us -variant intl
# To go back
setxkbmap -layout us
@stevenliebregt
stevenliebregt / staruml-colors.md
Last active September 13, 2018 16:31
StarUML Color Scheme

Activity Diagram

Element Color
Note #ffff91 #ffff91
Decision #ff7f00 #ff7f00
Merge #ad00ad #ad00ad
Action Text #2b2bff #2b2bff
Guard Text #007c3e #007c3e
@stevenliebregt
stevenliebregt / inserts.sql
Created September 25, 2018 13:39
Nu met hoofdletters
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Griet Reukers","1988-11-28","Nederland",NULL);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Daantje Uiterwaal",NULL,"Roemenië",1.84);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Gustaaf Wagner",NULL,"Malta",NULL);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Thijs de Beurs","1993-01-23","Tsjechië",NULL);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Zwier Schra",NULL,"Malta",1.99);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Bartje Bosschaart",NULL,NULL,1.39);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Louwrens Versloot",NULL,NULL,NULL);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Berg Gomes","1987-12-02","Nederland",NULL);
INSERT INTO Acteurs (naam,geboortedatum,geboorteland,lengte) VALUES("Hilbrand van Mil","1955-07-12","Zweden",1.41);
INSERT INTO Acteurs (naam,geboorted
Alt+30 ▲
Alt+31 ▼
Alt+16 ►
Alt+17 ◄