This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Fake aptitude or apt-get cli so that: | |
# aptitude install rhythmbox-applet | |
# Gets translated to: | |
# yaourt -S rhythmbox-applet | |
ARGV[0] = case ARGV[0] | |
when 'update': '-Sy' | |
when 'install', 'reinstall': '-S' | |
when 'search': '-Ss' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# automatic screen reattach on ssh-connection | |
if [ -n "$SSH_CONNECTION" ] && [ "$TERM" != 'screen' ] && [ -z "$SCREEN_EXIST" ]; then | |
export SCREEN_EXIST=1 | |
screen -DR | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is-git? { | |
git status &> /dev/null | |
[ $? != 128 ] | |
} | |
function git-init-remote { | |
name=$(basename $PWD).git | |
path=~/repositories/$name | |
if is-git? | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is-git? { | |
git status &> /dev/null | |
[ $? != 128 ] | |
} | |
function git-init-remote { | |
name=$(basename $PWD).git | |
path=~/repositories/$name | |
if is-git?; then | |
ssh bearnaise.net -t "mkdir $path && cd $path && git --bare init" || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Searches for music titles to listen to, using the seeqpod.com API. | |
# | |
# You will need a seeqpod UID for that. To get one, just create a free account | |
# on seeqpod.com and look in your settings. | |
# | |
# $ ruby dlmusic.rb Radiohead Just | |
# Radiohead/Just (You Do It To Yourself) | |
# ⤷ http://infonistacrat.hometownproject.org/audio/2122008/Radiohead%20-%20Just.mp3 | |
# Radiohead/Just |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Written by Antoine 'NaPs' Millet | |
# | |
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
# Version 2, December 2004 | |
# | |
# Copyright (C) 2004 Sam Hocevar | |
# 14 rue de Plaisance, 75014 Paris, France | |
# Everyone is permitted to copy and distribute verbatim or modified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Object.to_pretty | |
# Prints hashes and arrays on multiple lines. It reads better. | |
# | |
# Example: | |
# h = {"logdir"=>"/var/log/foo/", "server"=>{"sahara"=>{"osversion"=>"2.6", "osname"=>"solaris", "address"=>["10.0.0.101", "10.0.1.101"]}}, "debugfile"=>"/tmp/foo.debug"} | |
# puts h.to_pretty | |
# | |
# Prints: | |
# { | |
# "logdir" => "/var/log/foo/", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Decay class, to call a callback less and less often. For example, | |
// make an Ajax request and freshen the decay only if the request has changed. | |
// | |
// To start the timeouts, call decay_object.start() | |
// To freshen up the speed of query, call decay_object.reset() | |
// | |
// Options: | |
// - seconds: time between each callback at the start and after a reset() (default 2) | |
// - decay: multiplier to use after each callback call (default 1.3) | |
// - max: maximum number of seconds to wait between each call (default 42) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
01:38,39,69,71,73,74 | |
02:08,51,59,60,77,80 | |
03:18,23,42,58,63,71 | |
04:05,06,26,83,84 | |
05:04,26,38,73 | |
06:04,83 | |
07:26,30,38,42,43,48,84 | |
08:02,51,55 | |
09:11,31,66 | |
10:21,51,52,77,89 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shoes.app :title => "Heure de fin", :width => 200, :height => 160, :resizable => false do | |
background "#FFF".."#DDD" | |
stack :margin => 10 do | |
flow { | |
para "Arrivée à" | |
@time_start = edit_line(:width => 42, :text => '10h00') { calc } | |
} | |
flow { | |
para "Travailler" |