View List all files in any git branch of the current repo.sh
(for branch in $(git branch -l) ; do git archive $branch | tar -l ; done) | sort | uniq
View Track all remote branches for the current repository.sh
for branch in $(git branch -r | grep -v HEAD) ; do git branch --track $(echo $branch | cut -f2- -d/) $branch ; done
View ptr_inspect.c
/*
ptr_inspect.c
Demonstration code; shows how to trace the system calls in a child
process with ptrace. Only works on 64-bit x86 Linux for now, I'm
afraid. (Even worse, it's only tested on Linux 2.6....)
The callname() function looks clunky and machine-generated because it
*is* clunky and machine-generated.
View addmint.py
#!/usr/bin/env python
# encoding: utf-8
"""
addmint.py
Adds Mint analytics to a static HTML page; requires BeautifulSoup.
(I use this for Aperture exports.)
Created by Will Benton on 2008-07-15.
View jikesrvm-svn-mirror.sh
#!/bin/sh
# you probably want automatic git-gc before running this:
# git config --global gc.auto 1
mkdir jikesrvm.svn.sourceforge.net
(cd jikesrvm.svn.sourceforge.net && rsync -avz jikesrvm.svn.sourceforge.net::svn/jikesrvm/\* .)
git svn clone -s file://$(pwd)/jikesrvm.svn.sourceforge.net/rvmroot/ jikesrvm.git
View gist:31823
python - << EOF
import sys
vtup = sys.version_info
version = vtup[0] * 100 + vtup[1] * 10 + vtup[2]
if version < 240:
sys.exit(1)
sys.exit(0)
EOF
View pytest.c
/*
Simple timing test of exec-ing versus embedding python interpreter.
Note that to embed python programs with dynamically loaded extension
modules, you'll need to do some special linking tricks:
http://www.python.org/doc/2.5.2/ext/link-reqs.html
Compile this file with something like:
View gist:86317
# bit-for-bit copy of the drive at /dev/sda to sda.img on a removable disk
dd if=/dev/sda of=/media/removable/sda.img bs=1024
View gist:86330
# convert sda.img to a QEMU disk image
qemu-img convert -f raw sda.img -O qcow sda-qcow.img
# convert sda.img to a vmware disk image
qemu-img convert -f raw sda.img -O vmdk sda.vmdk
View repr.cc
// Trivial example of using virtual dispatch to hide template parameters from clients, as
// alluded to here: http://chapeau.freevariable.com/2009/06/a-problem-of-dependent-types.html
#include <iostream>
#include <list>
#include <tr1/memory>
class repr {
public:
virtual ~repr() { }