Skip to content

Instantly share code, notes, and snippets.

View yaf's full-sized avatar

Yannick François yaf

View GitHub Profile
curl -H "Content-Type: text/html; charset=utf-8" \
--data-binary @FILE.html \
https://validator.w3.org/nu/?out=gnu
@yaf
yaf / todo.sh
Created February 14, 2016 21:12
Todo list tool
todo(){ cd ~/.todo||return 1&& l=$(ls -1t|head -n1)&&t=$(date +%Y%m%d);[[ "$1" == "last" ]]&&cp $l $t; ${EDITOR:-vi} $t;cd -;}
xrandr --output LVDS1 --mode 1366x768 --output VGA1 --mode 1280x960 --same-as LVDS1
xrandr --output LVDS1 --mode 1366x768 --output VGA1 --mode 1024x768i --same-as LVDS1
xrandr --output LVDS1 --mode 1360x768 --output VGA1 --mode 1024x768i --same-as LVDS1
xrandr --output LVDS1 --mode 1024x768 --output VGA1 --mode 1024x768i --same-as LVDS1
git clean -nxd
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
@yaf
yaf / deploy
Created May 27, 2015 21:11
From a source branch that generate in a _site directory a static web site to a gh-pages branch !
#!/bin/sh
git co gh-pages && git co source:_site -- . && git ci -m 'update site' && git push
@yaf
yaf / gist:9fef3b5840a239a8756f
Created April 22, 2015 16:29
add url for push
git remote set-url --add origin git@gitlab.com:...
@yaf
yaf / pngcrush.sh
Created April 4, 2015 21:48
Png Crush
# Daily one-liner
find . -name *.png | parallel -n 1 'pngcrush -rem allb -brute -reduce {} {}.new | grep "filesize" && mv {}.new {}'
@yaf
yaf / UTF-8-demo.txt
Created April 4, 2015 20:35
UTF-8 démo
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
git commit --date=2.days.ago -m "set in the past" --allow-empty