Skip to content

Instantly share code, notes, and snippets.

View byroot's full-sized avatar

Jean Boussier byroot

View GitHub Profile
@byroot
byroot / eols.sh
Created March 27, 2012 15:08
Convert the whole git history with dos2unix
git filter-branch --tree-filter 'git ls-files -z | xargs -0 dos2unix' -- --all
@byroot
byroot / git-squash.sh
Created March 19, 2012 09:58
Git squash
#!/bin/bash -e
# Go back to the last commit that we want to form the initial commit (detach HEAD)
branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
tag="tmp-$RANDOM"
git checkout HEAD
# reset the branch pointer to the initial commit,
# but leaving the index and working tree intact.
git reset --soft HEAD~1
/*****************************************************************************
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
------------------------------------------------------------------------------
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
#!/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
@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
@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
# A sample Gemfile
source "http://rubygems.org"
gem "koala", '1.2.1'
gem 'json'
GET /votes/ACTA_resolution/693/abstention/
avant: 272 -> 84ms
après 116 -> 69ms
\o/
MEP.objects.filter(countrymep__end__gt=d, countrymep__begin__lt=d).extra(select={'current_country_id': 'meps_countrymep.country_id'})