View gist:951011
// This bookmarklet provides a way to navigate "related link" tags, like <link rel="Prev"... /> <link rel="Next"... />.
// Copy and paste this into a bookmark:
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.5.2",function($,L){var d=$("<div/>");$("link").each(function(){d.append($("<a/>").attr("href",$(this).attr("href")).text("["+$(this).attr("rel")+"] "+$(this).attr("title")));d.append("<br/>")});$("body").prepend(d);});
// Original source, before minifying and JQuery-enabling.
// minify: http://www.refresh-sf.com/yui/
// jQuery-enabling: http://benalman.com/projects/run-jquery-code-bookmarklet/
var d = $('<div/>');
$('link').each(function
View anime-favorites.md

I began to want a tabular format and Github-flavored-markdown was becoming too tedious, so I moved this to Google Docs: datagrok's anime favorites

Text below is not yet incorporated into that spreadsheet


Also,

  • Anything with music by Susumu HIRASAWA (= Anything written, directed, or animated by Satoshi KON).
  • Anything with music by Yoko KANNO.
View colorscheme_builder.py
"""Colorscheme builder
Future improvements: Twisting the 'hue' knob in HSV
colorspace isn't necessarily the best way to procedurally
choose colors. I'd like to explore the use of other
"perceptual" colorspaces like L*A*B* for calculating
uniform hue spreads.
"""
View output.html
<html>
<head>
<style>
p {width: 20em;}
</style>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Does my
sparkline <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAPAgMAAADFfETiAAAADFBMVEX/////AACAbIAAAAAe6DapAAAAWUlEQVR42m3OKw7AQAgE0BEVc6wVK3osRAXH7vBZUlHEwEsgAQtZu/LCjyPCdkyZYzt27AfLfGwyZF+GtE7Sd9llKp3RybZZTGO2tacnSIzZzvga5a5yNOAFUsco8dm3E2wAAAAASUVORK5CYII="> fit in a nice paragraph of text? Ut enim
View array_to_object.coffee
assert = require 'assert'
# Imagine some function fn(x). For example:
fn = (x) -> x+1
# We want to build from a given Array of keys an Object whose values represent
# the result of that asyncronous function. For example,
input_keys = [
View gist:2199506

Virtualenv's bin/activate is Doing It Wrong

I'm a Python programmer and frequently work with the excellent [virtualenv][] tool by Ian Bicking.

Virtualenv is a great tool on the whole but there is one glaring problem: the activate script that virtualenv provides as a convenience to enable its functionality requires you to source it with your shell to invoke it. The activate script sets some environment variables in your current environment and defines for you a deactivate shell function which will (attempt to) help you to undo those changes later.

This pattern is abhorrently wrong and un-unix-y. activate should instead do what ssh-agent does, and launch a sub-shell or sub-command with a modified environment.

Problems

View profundity.sh
#!/bin/sh
#
# usage: profundity.sh Downloads/grevious_injury.jpg "fuck fucking fuck\ni am so angry over trivial annoyances\ni wish you physical bodily harm"
#
attr="https://gist.github.com/3660292"
convert "$1" \
-brightness-contrast "-10x-20" \
-resize 1920x1920 \
View mutt-ldap.py
#!/usr/bin/python
'''This is a python port of http://www.bsdconsulting.no/tools/mutt-ldap.pl
'''
import ldap
# To do:
# - encode search string as UTF-8
View deploy.sh
#!/bin/sh
# deploy.sh
N="`readlink \"$1\"`"
mv -T "$1.stage" "$1"
ln -s "$N" "$1.stage"
rm -rf "$N"
cp -aH "$1" "$N"
View git-branch-simplify.md

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.