Skip to content

Instantly share code, notes, and snippets.

View sunny's full-sized avatar
☀️

Sunny Ripert sunny

☀️
View GitHub Profile
@sunny
sunny / gist:7375
Created August 26, 2008 22:45
Translates aptitude/apt-get commands to archlinux's pacman/yaourt
#!/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'
# automatic screen reattach on ssh-connection
if [ -n "$SSH_CONNECTION" ] && [ "$TERM" != 'screen' ] && [ -z "$SCREEN_EXIST" ]; then
export SCREEN_EXIST=1
screen -DR
fi
function is-git? {
git status &> /dev/null
[ $? != 128 ]
}
function git-init-remote {
name=$(basename $PWD).git
path=~/repositories/$name
if is-git?
then
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" ||
#!/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
@sunny
sunny / sniffarp.py
Created September 20, 2008 13:17 — forked from NaPs/sniffarp.py
#!/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
# 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/",
@sunny
sunny / decay.js
Created September 30, 2008 09:05
// 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)
@sunny
sunny / liste-de-departements-limitrophes-francais.txt
Last active March 20, 2024 09:47
Liste de départements limitrophes français
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
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"