Skip to content

Instantly share code, notes, and snippets.

View yaf's full-sized avatar

Yannick François yaf

View GitHub Profile
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
@yaf
yaf / do_while.sh
Created November 22, 2011 13:41
do while, autospec en shel
while true; do clear; date; rake spec; sleep 1; done
@yaf
yaf / rmagick_color_histo.rb
Created June 7, 2013 06:49
rmagick color histo
require 'rmagick'
img = Magick::ImageList.new('sudo_graph_20110807.jpg')
puts Magick::QuantumDepth
histo_color = img.quantize(10).color_histogram
#http://xona.com/colorlist/
#8 255
#16 65535
@yaf
yaf / ruby_http_server
Last active December 23, 2015 10:29
Ruby simple http server
ruby -run -e httpd . -p 8000
@yaf
yaf / MasterMind.hs
Last active December 29, 2015 10:19
import Test.HUnit
main = do runTestTT $ TestList [
juge [Rouge, Vert, Orange, Bleu] [Rouge, Vert, Orange, Bleu] ~?= End True
,juge [Rouge, Vert, Orange, Bleu] [Jaune, Vert, Jaune, Jaune] ~?= Retry (BienPlacé 1, MalPlacé 0)
,juge [Rouge, Vert, Orange, Bleu] [Jaune, Vert, Orange, Jaune] ~?= Retry (BienPlacé 2, MalPlacé 0)
,juge [Rouge, Vert, Orange, Bleu] [Vert, Jaune, Jaune, Jaune] ~?= Retry (BienPlacé 0, MalPlacé 1)
,juge [Rouge, Orange, Rouge, Rouge] [Orange, Orange, Orange, Orange] ~?= Retry (BienPlacé 1, MalPlacé 0)
]
@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 -;}
curl -H "Content-Type: text/html; charset=utf-8" \
--data-binary @FILE.html \
https://validator.w3.org/nu/?out=gnu
@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

Keybase proof

I hereby claim:

  • I am yaf on github.
  • I am ya_f (https://keybase.io/ya_f) on keybase.
  • I have a public key ASBAUhe0KEwpEtGUyAXIWqHVnDILFoqdSVCJ0EN5WI5d2go

To claim this, I am signing this object:

@yaf
yaf / hello.rb
Last active October 12, 2020 21:40
begin
phrase("Henri")
rescue
puts "erreur, la fonction phrase() n'existe pas encore"
end
require "./une_lib"
puts "Hello depuis le fichier executé : hello.rb"