Skip to content

Instantly share code, notes, and snippets.

View yaf's full-sized avatar

Yannick François yaf

View GitHub Profile
@yaf
yaf / jonesforth.f.txt
Last active March 28, 2024 12:08
Jones Forth fantastic simple 4th implementation written from assembly, that is remarkably readable
\ -*- text -*-
\ A sometimes minimal FORTH compiler and tutorial for Linux / i386 systems. -*- asm -*-
\ By Richard W.M. Jones <[email protected]> http://annexia.org/forth
\ This is PUBLIC DOMAIN (see public domain release statement below).
\ $Id: jonesforth.f,v 1.17 2007/10/12 20:07:44 rich Exp $
\
\ The first part of this tutorial is in jonesforth.S. Get if from http://annexia.org/forth
\
\ PUBLIC DOMAIN ----------------------------------------------------------------------
\
@yaf
yaf / binomage-tmux
Created March 29, 2016 14:03
Use to connect to a tmux session named "binomage". Start this session with -L on machine , and add this line in ~/.ssh/authorized_keys file
command="/usr/bin/tmux -L binomage attach",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-rsa
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 [email protected]:...
@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 {}'