Skip to content

Instantly share code, notes, and snippets.

View dan's full-sized avatar
🕶️
Seeking restitution for my ruined rug.

Dan Benjamin dan

🕶️
Seeking restitution for my ruined rug.
View GitHub Profile
@dan
dan / .bash_profile
Created May 23, 2009 10:38
Display your current git-branch in your prompt
# This will display your current git-branch in your prompt.
# It looks best on a lighter background.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\e[1;32m\]\u@\e[1;31m\]\h\e[0m\]:\e[1;34m\]\w\e[0m\] \$(parse_git_branch)\n\$ "
@dan
dan / update_git_projects.sh
Created June 16, 2009 13:06
Runs a "git pull origin master" in every subfolder of your work/projects folder. Handy for updating everything. Quietly fails for non-git projects.
#!/bin/sh
cd ~/work
for dir in `find . -type d -maxdepth 1 -mindepth 1`; do cd $dir; git pull origin master; cd -; done
@dan
dan / Makefile.osx
Created September 18, 2009 15:13
Makefile for building FreeImage on OS X
# -*- Makefile -*-
# Mac OSX makefile for FreeImage
# This file can be generated by ./gensrclist.sh
include Makefile.srcs
# General configuration variables:
CC_X86_64 = gcc-4.2
CC_I386 = gcc-4.2
CPP_X86_64 = g++-4.2
<ol>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=303781960&amp;s=143441">Dr. No</a></li>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=303888092&amp;s=143441">From Russia with Love</a></li>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=303823225&amp;s=143441">Goldfinger</a></li>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=338387285&amp;s=143441">Thunderball</a></li>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=338391655&amp;s=143441">You Only Live Twice</a></li>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=338642876&amp;s=143441">On Her Majesty&#8217;s Secret Service</a></li>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=303990510&amp;s=143441">Diamonds Are Forever</a></li>
<li>Live and Let Die</li>
<li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMovie?id=338418687&amp;
server {
listen 80;
server_name wiki.com;
root /sites/wiki;
location / {
index index.php5;
error_page 404 = @mediawiki;
}
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@dan
dan / gist:964832
Created May 10, 2011 16:31
Disable Skype Auto-Gain
~/Library/Application Support/Skype/shared.xml
After <VoiceEng>
Add
<AGC>0</AGC>
Can also disable echo cancelation you could do so by adding the following line:
<!-- javascript -->
<script src="/javascripts/jquery-1.5.2.min.js?1312202042" type="text/javascript"></script>
<script src="/javascripts/jquery.imghover-1.1rc.js?1312202042" type="text/javascript"></script>
<script src="/javascripts/5by5.image_hover.js?1312202042" type="text/javascript"></script>
<!-- page-specific javascript -->
<script src="/javascripts/5by5.links_in_new_window.js?1312202042" type="text/javascript"></script>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script src="/javascripts/swfobject.js?1312202042" type="text/javascript"></script>
<script src="/jwplayer/jwplayer.js?1312122387" type="text/javascript"></script>
@dan
dan / usagi_yojimbo.txt
Created December 8, 2011 15:38
Needed Usagi Yojimbo Issues:
NEEDED USAGI YOJIMBO ISSUES
Volume 1:
2, 9
Volume 2:
2, 11-14, 16
Volume 3:
1-7, 9-11, 13, 19, 22, 28-30, 40, 55, 128
@dan
dan / techmeme_optima_fix.markdown
Created January 27, 2012 15:04
Fixing TechMeme's Poor Choice of Optima for its Typeface

First get this Safari Extension.

Then use this custom style sheet:

body,
.ii strong,
.drhed, cite,
.nfdl,
.navbar,