Create a public gist:
This file contains 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
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |
This file contains 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
# Add this self removing snippet to someone's .bashrc, or .zshrc. #DELETEME | |
# So next time they ssh in, or open a terminal... NYAN CAT!! #DELETEME | |
CONF_FILE=$HOME/.bashrc #DELETEME | |
(sleep 15 && killall telnet > /dev/null 2>&1) & #DELETEME | |
telnet miku.acm.uiuc.edu #DELETEME | |
reset #DELETEME | |
clear #DELETEME | |
sed '/#DELETEME/d' $CONF_FILE > /tmp/$(basename $CONF_FILE) #DELETEME | |
cat /tmp/$(basename $CONF_FILE) > $CONF_FILE #DELETEME | |
rm -f /tmp/$(basename $CONF_FILE) #DELETEME |
This file contains 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
#!/usr/bin/env python | |
"""Store messages in a Maildir into a couchdb database.""" | |
import couchdb | |
from mailbox import Maildir | |
from optparse import OptionParser | |
import os | |
from pprint import pprint | |
import sys | |
from uuid import uuid4 |
This file contains 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
import functools | |
import inspect | |
# OMG, what have I done!? (Don't read this bit. Ever.) | |
class inject(object): | |
@classmethod | |
def require(__cls, *args): | |
def decorator(func): | |
functools.wraps(func) |
This file contains 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
#!/bin/sh | |
# Save this in a file in an empty dir, then run. | |
__global=./ | |
__object=__mytype | |
__object_id=my-id | |
# All events go here | |
exec 10>$__global/post_config_events |
This file contains 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
#!/bin/sh | |
backup() | |
{ | |
[ -e "$1" ] && mv "$1" "$1.backup.$(date +%s)" | |
} | |
backup ~/.pdbrc.py | |
cat > ~/.pdbrc.py <<EOF | |
import pdb | |
class Config(pdb.DefaultConfig): |
This file contains 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
__profile_d() | |
{ | |
# i.e. __profile_d_mysql_ssl/foo/bar | |
local d=$1 | |
[ "$d" ] || exit 0 | |
if [ "${d%__profile_d*}" ]; then | |
echo "$d" | |
exit 0 | |
fi | |
# i.e. foo/bar |
This file contains 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
antimuon:~$ traceroute patents.com | |
traceroute: Warning: patents.com has multiple addresses; using 199.16.153.11 | |
traceroute to patents.com (199.16.153.11), 64 hops max, 52 byte packets | |
1 10.0.1.1 (10.0.1.1) 8.736 ms 5.836 ms 4.002 ms | |
2 * * * | |
3 83-169-179-86-isp.superkabel.de (83.169.179.86) 41.602 ms 38.353 ms 39.961 ms | |
4 88-134-192-56-dynip.superkabel.de (88.134.192.56) 13.402 ms 9.123 ms 7.756 ms | |
5 88-134-204-150-dynip.superkabel.de (88.134.204.150) 11.027 ms 8.134 ms 13.547 ms | |
6 83-169-128-22.static.superkabel.de (83.169.128.22) 12.880 ms 23.179 ms 26.520 ms | |
7 88-134-201-117-dynip.superkabel.de (88.134.201.117) 9.068 ms 11.654 ms 10.706 ms |
This file contains 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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2281433/hack.sh | sh | |
# |
OlderNewer