Skip to content

Instantly share code, notes, and snippets.

View czj's full-sized avatar

Clément Joubert czj

View GitHub Profile
function init_checkout_selection_table(id) {
var table = $(id);
var clicked_td = null;
// Clicking on the input box changes the row to active
// Add this behaviour + simulate the first click
// Use triggerHandler to only execute the function (the input is already clicked)
table.find('input').on('click', function(event) {
table.find('.active').removeClass('active');
clicked_td = $(this).closest('td');
@czj
czj / mame.markdown
Created October 21, 2011 20:25
Meilleurs jeux MAME

Meilleurs jeux MAME

Shoot'em up

  • Raiden **** (trop dur)
  • Raiden Fighters Jet **** (1990 trop joli, bien dur)
  • PROGEAR (2001, CAVE, trop dur)
  • ESP Galuda
  • ESP Galuda 2
  • Blazing Star (Neo Geo, pas trop harcode)
@czj
czj / gist:1263872
Created October 5, 2011 07:39
Script to encode with HandbrakeCLI (x264) 720p, high image quality, low file size
#!/usr/bin/env ruby
# encoding: utf-8
# x264 presets guide : https://forum.handbrake.fr/viewtopic.php?f=6&t=19426
X264 = "b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all"
FORMAT = "--optimize --format mp4"
QUALITY = "--ab 64 --mixdown mono --quality 23 -e x264 -x '#{X264}'"
SIZE = "--width 1280 --height 720"
ARGV.each do |param|
@czj
czj / hosts
Created October 4, 2011 08:24
Hosts file for ads removal
127.0.0.1 da.feedportal.com
127.0.0.1 rss.feedportal.com
127.0.0.1 com.clubic.feedsportal.com
@czj
czj / gist:1261139
Created October 4, 2011 08:20
CSS filtering for Google Reader (remove ads & useless links)
/*
http://www.google.fr/reader/*
*/
a[href*=feedburner],
a[href*=feedsportal],
img[src*=feedsportal] {
display:none !important;
}
@czj
czj / gist:1251040
Created September 29, 2011 15:45
Custom .pryrc for OSX + Rails + polite
# This script is greatly inspired by Pry Everywhere by Luca Pette
# http://lucapette.com/pry/pry-everywhere/
# Use TextMate as default editor
Pry.config.editor = "mate -w"
# My pry is polite
Pry.hooks = {
:after_session => proc {
puts "\nGoodbye." if Pry.active_sessions == 1
@czj
czj / gist:1251031
Created September 29, 2011 15:43
.irbrc that runs Pry instead of IRB
# This script comes from Pry Everywhere by Luca Pette
# http://lucapette.com/pry/pry-everywhere/
# https://github.com/carlhuda/bundler/issues/183#issuecomment-1149953
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
@czj
czj / sabnzdb_upgrade.sh
Created September 27, 2011 09:40
SABnzdb+ auto-update script
#!/bin/bash
cd ~/bin
API_KEY=`cat SABnzbd/sabnzbd.ini | grep ^api_key | awk '{print $3}'`
PORT=` cat SABnzbd/sabnzbd.ini | grep ^https_port | awk '{print $3}'`
VERSION=`curl -s http://sabnzbdplus.sourceforge.net/version/latest | head -n1`
VERSION=${VERSION%?}
DIR="SABnzbd-${VERSION}"
GZ="${DIR}-src.tar.gz"
# encoding: utf-8
class String
EUROPEAN_ACCENTS = {
['Ã','Ä','Â','À'] => 'A',
['á','à','â','ä','ã'] => 'a',
['Ë','É','È','Ê'] => 'E',
['é','è','ê','ë'] => 'e',
['Î','Ì'] => 'I',
['í','ì','î','ï'] => 'i',
['Õ','Ö','Ô','Ò'] => 'O',
@czj
czj / gist:1181795
Created August 30, 2011 19:31
Format de fichier Google Shopping France
Cher partenaire,
Nous annonçons aujourd'hui des changements dans nos spécifications techniques de flux pour les pays suivants : France, Angleterre, Allemagne et USA.
L'objectif de ce changement est d'améliorer la qualité de l'information transmise aux internautes de Google. Notre blogpost : http://adwords-fr.blogspot.com/
Vous avez jusqu'au 22 septembre pour faire les changements - au delà de cette date, votre flux ne sera plus validé. Nous vous recommandons de faire ces changements au plus vite.
Les attributs suivants deviennent obligatoires :
- [image link]
- [availability]