This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ABKiller | |
// @namespace http://www.github.com/MichaelBlume/ | |
// @description Kill the action bar on OKCupid profiles | |
// @include http://www.okcupid.com/profile/* | |
// @include http://okcupid.com/profile/* | |
// ==/UserScript== | |
var action_bar = document.getElementById('action_bar'); | |
action_bar.parentNode.removeChild(action_bar); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch -f --parent-filter ' | |
if [ "$GIT_COMMIT" = "SHA_GOES_HERE" ]; | |
then | |
echo '' | |
else | |
read parents; | |
echo $parents; | |
fi' -- --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch -f --commit-filter ' | |
if [ "$GIT_COMMITTER_NAME" = "name" ]; | |
then | |
GIT_COMMITTER_NAME="New Name"; | |
GIT_COMMITTER_EMAIL="[email protected]"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; | |
fi' -- --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --msg-filter 'sed -e "/^git-svn-id:/d" ' -- --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias g="git" | |
alias com="g commit" | |
alias add="g add" | |
alias dif="g diff" | |
alias res="g reset" | |
alias co="g checkout" | |
alias branch="g branch" | |
alias merge="g merge" | |
alias st="g status" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[advice] | |
# I know this stuff by now | |
pushNonFastForward = false | |
statusHints = false | |
[alias] | |
a = add | |
ai = add --interactive | |
ap = add --patch | |
b = branch | |
bl = blame |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''deepdict: quickly create highly nested dictionary structures without lots | |
of initialization steps.''' | |
from collections import defaultdict | |
class deepdict(defaultdict): | |
def __init__(self, *a, **kw): | |
defaultdict.__init__(self, deepdict, *a, **kw) | |
def __add__(self, num): | |
return num |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Localdict -- reduce your typing by half when constructing a dictionary | |
literal from objects in the local context. | |
params = {'foo': foo, 'bar': bar, 'baz': baz} | |
can be replaced ith | |
params = localdict('foo', 'bar', 'baz') | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compose_defaults(*defaults): | |
'''I got annoyed that simplejson.dumps doesn't let you pass multiple | |
defaults. So here's this.''' | |
def new_default(obj): | |
for default in defaults: | |
try: | |
return default(obj) | |
except: | |
pass | |
raise TypeError("no default functions succeeded") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qualia = ("red", "blue", "cold", "pleasure") | |
memory_associations = { "red": ("anger", "hot") | |
, "blue": ("cold", "calm") | |
, "pleasure": ("hot", "good") | |
, "cold": ("blue", "calm") | |
} | |
def experience_qualia(in_qual): | |
for q in qualia: | |
if in_qual == q: |
OlderNewer