Skip to content

Instantly share code, notes, and snippets.

View jpcaruana's full-sized avatar

Jean-Philippe Caruana jpcaruana

View GitHub Profile
@jpcaruana
jpcaruana / .gitignore
Created November 24, 2011 15:49
a stupid twitter implementation using redis + Python
*.pyc
@jpcaruana
jpcaruana / gist:2642747
Created May 9, 2012 07:42 — forked from mtnygard/gist:2254147
Books I recommended today
@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: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 / 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 / dvorak
Created August 10, 2012 15:15
clavier dvorak avec compose (pour les accents)
setxkbmap dvorak en -option compose:ralt
@jpcaruana
jpcaruana / lxde-rc.xml
Created August 10, 2012 15:20
binding pour switcher entre les claviers dvorak/azerty
<keybind key="W-F5">
<action name="Execute">
<command>~/bin/switch_dv_fr</command>
</action>
</keybind>
@jpcaruana
jpcaruana / switch_dv_fr.sh
Created August 10, 2012 15:26
switch between dvorak and azerty keyboards
#!/bin/bash
kbd=`setxkbmap -query | grep layout | awk '{print $2}'`
if [ 'fr' = $kbd ]
then
notify-send 'Keyboard is now Dvorak'
setxkbmap dvorak en -option compose:ralt
else
notify-send 'Keyboard is now French'
@jpcaruana
jpcaruana / xinput list
Created August 10, 2012 15:35
xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB Optical Mouse id=8 [slave pointer (2)]
⎜ ↳ HID 046a:0023 id=10 [slave pointer (2)]
⎜ ↳ TypeMatrix.com USB Keyboard id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ HID 046a:0023 id=9 [slave keyboard (3)]
@jpcaruana
jpcaruana / multi.py
Created September 19, 2012 16:37
non blocking HTTP GET
# -*- coding: utf-8 -*-
from datetime import datetime
import multiprocessing, time, urllib2
class Browser(object):
def __init__(self):
self.p = None
def request(self, s):