Skip to content

Instantly share code, notes, and snippets.

View byroot's full-sized avatar

Jean Boussier byroot

View GitHub Profile
diff --git a/parltrack/current_meps_json_2_sql.py b/parltrack/current_meps_json_2_sql.py
index 1690f46..9053972 100644
--- a/parltrack/current_meps_json_2_sql.py
+++ b/parltrack/current_meps_json_2_sql.py
@@ -174,8 +174,8 @@ def add_addrs(mep, addrs):
name=bxl["Address"]["Building"],
street=bxl["Address"]["Street"],
postcode=bxl["Address"]["Zip"])
- mep.bxl_floor = bxl["Address"]["Office"][:3]
- mep.bxl_office_number = bxl["Address"]["Office"][3:]
#!/usr/bin/env python
import threading
import subprocess
results = []
def launch_job(arg):
results.append(subprocess.Popen(['/bin/echo %s' % arg], shell=True, stdout=subprocess.PIPE).communicate()[0])
MEP.objects.filter(countrymep__end__gt=d, countrymep__begin__lt=d).extra(select={'current_country_id': 'meps_countrymep.country_id'})
GET /votes/ACTA_resolution/693/abstention/
avant: 272 -> 84ms
après 116 -> 69ms
\o/
# A sample Gemfile
source "http://rubygems.org"
gem "koala", '1.2.1'
gem 'json'
@byroot
byroot / powder.completion.sh
Created November 2, 2011 10:42
Powder bash completion
_powder() {
local POW_COMMANDS='applog config down help install link list log open remove restart status uninstall up version'
local cur="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=( $(compgen -W "$POW_COMMANDS" -- "$cur") )
return 0
}
complete -F _powder powder
@byroot
byroot / chrome_disable_web_security.sh
Created November 7, 2011 10:57
Shell helper for easy Facebook iframe debug in chrome (Mac OS only)
CHROME_BIN_DIR="/Applications/Google\ Chrome\ Canary.app/Contents/MacOS"
CHROME_BIN_BAK="$CHROME_BIN_DIR/chrome.bin"
CHROME_BIN="$CHROME_BIN_DIR/Google Chrome"
function is_chrome_tweaked() {
/usr/bin/file -b "$CHROME_BIN" | grep -q ASCII || /usr/bin/file -b "$CHROME_BIN" | grep -q shell
}
function tweak_chrome() {
if is_chrome_tweaked ; then
#!/usr/bin/python
class ItemMetaClass(type):
ITEM_CLASSES_INDEX = {}
def __new__(mcs, name, bases, dict):
cls = type.__new__(mcs, name, bases, dict)
if hasattr(cls, 'id'):
mcs.ITEM_CLASSES_INDEX[cls.id] = cls
return cls
From 84ac611267f44d8b0bd1fdec2cf92b24cebd4907 Mon Sep 17 00:00:00 2001
From: Jean Boussier <jean.boussier@tigerlilyapps.com>
Date: Tue, 3 Jan 2012 10:55:46 +0100
Subject: [PATCH] Fix jquery.placeholder to avoid absolute positions
---
vendor/assets/javascripts/jquery.placeholder.js | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/vendor/assets/javascripts/jquery.placeholder.js b/vendor/assets/javascripts/jquery.placeholder.js
/*****************************************************************************
jQuery Placeholder 1.1.9
Copyright (c) 2010 Michael J. Ryan (http://tracker1.info/)
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
------------------------------------------------------------------------------