This file has moved to Technical Maxims
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
/* Extend jQuery with functions for PUT and DELETE requests. */ | |
/* Based on http://homework.nwsnet.de/news/9132_put-and-delete-with-jquery */ | |
(function(){ | |
function _ajax_request(url, data, callback, type, method) { | |
if (jQuery.isFunction(data)) { | |
callback = data; | |
data = {}; | |
} | |
return jQuery.ajax({ |
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
# Find ack on the system (even if it's been installed as ack-grep (linux) or ack-5.12 (MacPorts) and set up aliases | |
if [ "`compgen -c ack`" ]; then | |
ACK=`compgen -c ack | head -n 1` | |
alias ack=${ACK} | |
alias ackp="${ACK} --pager=less\ -R" | |
fi | |
# Note: this is not idempotent |
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
San Francisco California 2012 Endorsements | |||
---|---|---|---|
Democratic | Green | ||
Proposition 30 | Y | Y | |
Proposition 31 | N | N | |
Proposition 32 | N | N | |
Proposition 33 | N | N | |
Proposition 34 | Y | Y | |
Proposition 35 | Y | N | |
Proposition 36 | Y | Y | |
Proposition 37 | Y | Y |
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
// This is the proper way to catch click events on <a>nchor tags and dispatch them to Backbone.js's Router instead | |
$('a').live('click', function (event) { | |
var href = $(event.target).attr('href'); | |
if (href && // href attribute is defined | |
! /^\w+\:/i.exec(href) && // href does not begin with 'protocol:' | |
event.which == 1 && // first mouse button was pressed | |
! event.metaKey ) { // Command (Mac OS) or Ctrl (Windows) was not held down (otherwise the user wanted a new window from this link) | |
app.router.navigate(href, {trigger:true}); | |
return false; | |
} |
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
$ git pull | |
remote: Counting objects: 36, done. | |
remote: Compressing objects: 100% (15/15), done. | |
remote: Total 27 (delta 19), reused 20 (delta 12) | |
Unpacking objects: 100% (27/27), done. | |
Von github.com:glyphobet/myproject | |
581f38f..a83e75b mybranch -> origin/mybranch | |
There is no tracking information for the current branch. | |
Please specify which branch you want to merge with. | |
See git-pull(1) for details |
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/bash | |
mybasename=`basename $0` | |
if [ ! -e .git/hooks/${mybasename} ] ; then | |
ln -s ../../git-hooks/${mybasename} .git/hooks/${mybasename} | |
fi | |
if [ $3 ] && [ $3 -eq '1' ] ; then | |
# Start from the repository root. | |
pushd ./$(git rev-parse --show-cdup) > /dev/null |
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
def size_cmp(sizea, sizeb): | |
return cmp(size_value(sizea), size_value(sizeb)) | |
def size_value(size): | |
size = size.upper() | |
return (size.count('L') - size.count('S')) * (size.count('X') + 1) |
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
Punctual MUNI, which art in transit, | |
Punctual be thy name. | |
Thy arrival come. | |
Thy will be done, in Noe, | |
As it is in Dogpatch. | |
Give us this day our daily transfer. | |
And forgive us our fare evasions, | |
As we forgive them that do not know to step down. | |
And lead us not into Hunter's Point, | |
But deliver us from our stop. |
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
First shalt thou take out the Holy Virtualenv. Then, shalt thou | |
install using pip, no more, no less. pip shall be the installer | |
that thou shalt run. easy_install shalt thou not, nor either shalt | |
thou setup.py install, excepting that thou run setup.py via pip. | |
Sudo is right out. Once pip, being the installer you used, be used, | |
then installest thou thy Holy Package of Python Module towards | |
thine Virtualenv, which, being an .egg in my sight, shall install. |