- Valve: Handbook for new employees (PDF)
- Fog Creek: The Price of (Dev) Happiness
- Campaign Monitor: The new Campaign Monitor office
- Paul Graham: Great Hackers
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
function parse_git_branch { | |
git_status="$(git status 2> /dev/null)" | |
pattern="^# On branch ([^${IFS}]*)" | |
if [[ ! ${git_status}} =~ "working directory clean" ]]; then | |
state="*" | |
fi | |
# add an else if or two here if you want to get more specific | |
if [[ ${git_status} =~ ${pattern} ]]; then | |
branch=${BASH_REMATCH[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
<?php | |
/** | |
* Compare two strings by length first (descending), | |
* alphabetically second (ascending) | |
*/ | |
function strlen_cmp($a, $b) { | |
$diff = strlen($a) - strlen($b); | |
return ($diff != 0) ? -$diff : strcmp($a, $b); | |
} | |
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
javascript:void(function(){n=parseInt((location.href.split("/").pop().split("_")[0]),10);s="";while(n>0){s="123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"[n%2558]+s;n=Math.floor(n/58)};window.location="http://flic.kr/p/"+s;}()) |
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 | |
# -*- coding: utf8 -*- | |
"""Stemmers for Swedish and English | |
Implements the Swedish stemming algorithm used in snowball: | |
<http://snowball.tartarus.org/algorithms/swedish/stemmer.html> | |
Implements the English (Porter2) stemming algorithm used in snowball: | |
<http://snowball.tartarus.org/algorithms/english/stemmer.html> | |
""" |
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
# Call grep, with stdin closed if it is a terminal. | |
# | |
# Avoids the "eternal wait" problem when you've forgotten | |
# to specify a filename. | |
function grep { (tty -s && exec <&-; exec $(which grep) "$@"); } |
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
(function($) { | |
$.fn.inverse = function() { | |
var prevSelector = this.prevObject.selector, | |
suffix = this.selector.slice(prevSelector.length); | |
if (suffix.charAt(0) === " ") { | |
// Last action was a find | |
return this.prevObject.find(":not(" + suffix.slice(1) + ")"); | |
} else { | |
return this.prevObject.not(this); | |
} |
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
diff --git a/buildlibxml.py b/buildlibxml.py | |
index bfcf3e4..7bf36e5 100644 | |
--- a/buildlibxml.py | |
+++ b/buildlibxml.py | |
@@ -284,8 +284,11 @@ def build_libxml2xslt(download_dir, build_dir, | |
}) | |
else: | |
env.update({ | |
- 'CFLAGS' : "-arch ppc -arch i386 -arch x86_64 -O2", | |
- 'LDFLAGS' : "-arch ppc -arch i386 -arch x86_64", |
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 | |
# Copyright 2011 Filip Salomonsson <[email protected]> | |
# MIT Licensed | |
# Simple JSON pretty-printer | |
# Save as ~/bin/json and pipe stuff to it. | |
import json | |
import sys |
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
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
// by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
// Quartz Debug says. Who knows, maybe it's lying? | |
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
OlderNewer