Skip to content

Instantly share code, notes, and snippets.

View jpcaruana's full-sized avatar

Jean-Philippe Caruana jpcaruana

View GitHub Profile
@jpcaruana
jpcaruana / configure_keyboards
Created August 10, 2012 15:02
dvorak and fr
DVORAK=`xinput list | grep TypeMatrix | grep keyboard | sed 's/.*id=\([0-9]*\).*/\1/'`
AZERTY=`xinput list | grep HID | grep keyboard | sed 's/.*id=\([0-9]*\).*/\1/'`
setxkbmap -device $DVORAK dvorak -option compose:ralt
setxkbmap -device $AZERTY fr -option ""
@jpcaruana
jpcaruana / gist:2956906
Created June 19, 2012 22:31 — forked from andhapp/gist:2231347
Extract emails from google account
# Gemfile
source "http://rubygems.org"
gem 'mechanize'
gem 'hpricot'
# Ruby code
@jpcaruana
jpcaruana / .tmux.conf
Created May 9, 2012 17:18
my tmux conf file
# prefix is CTRL-B and CTRL-X
set -g prefix C-b,C-x
# enable CTRL-B and CTRL-X under other programms (like vim) - you'll have to press twice le combination to have the ancien one
bind C-b send-prefix
bind C-x send-prefix
# UTF-8
set-option -g status-utf8 on
set-window-option -g utf8 on
@jpcaruana
jpcaruana / gist:2642747
Created May 9, 2012 07:42 — forked from mtnygard/gist:2254147
Books I recommended today
@jpcaruana
jpcaruana / .gitignore
Created November 24, 2011 15:49
a stupid twitter implementation using redis + Python
*.pyc
@jpcaruana
jpcaruana / redis_pubsub_demo.rb
Created November 22, 2011 14:42 — forked from pietern/redis_pubsub_demo.rb
How to create a web chat with ruby & redis (Pieter Noordhuis)
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@jpcaruana
jpcaruana / autostart.sh
Created November 18, 2011 13:10
ma conf LXDE sous Mint
#!/bin/bash
xrandr --output VGA1 --auto --right-of HDMI1
@jpcaruana
jpcaruana / list.log
Created November 17, 2011 15:23
list.redis
redis 127.0.0.1:6379> RPUSH messages "Bienvenue dans redis"
(integer) 1
redis 127.0.0.1:6379> RPUSH messages "Merci pour cette petite introduction sur barreverte.fr"
(integer) 2
redis 127.0.0.1:6379> RPUSH messages "Non seulement je passe du bon temps, mais je m'amuse en meme temps"
(integer) 3
redis 127.0.0.1:6379> LRANGE messages 0 3
1) "Bienvenue dans redis"
2) "Merci pour cette petite introduction sur barreverte.fr"
3) "Non seulement je passe du bon temps, mais je m'amuse en meme temps"
@jpcaruana
jpcaruana / precompiler.rb
Created July 22, 2011 08:03 — forked from cacoco/precompiler.rb
Buildr Extension for precompiling JSP files.
module Precompiler
include Extension
first_time do
# Define task not specific to any projet.
desc 'Precompile jsps'
Project.local_task('precompile' => 'compile') { |name| "Precompiling #{name}" }
end
before_define do |project|
# Scavenged from Git 1.6.5.x contrib/completion/git_completion.bash
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# returns text to add to bash PS1 prompt (includes branch name)
__gitdir ()
{
if [ -z "${1-}" ]; then
if [ -n "${__git_dir-}" ]; then
echo "$__git_dir"
elif [ -d .git ]; then
echo .git