Instantly share code, notes, and snippets.

View List all files in any git branch of the current
(for branch in $(git branch -l) ; do git archive $branch | tar -l ; done) | sort | uniq
View Track all remote branches for the current
for branch in $(git branch -r | grep -v HEAD) ; do git branch --track $(echo $branch | cut -f2- -d/) $branch ; done
View 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.
#!/usr/bin/env python
# encoding: utf-8
Adds Mint analytics to a static HTML page; requires BeautifulSoup.
(I use this for Aperture exports.)
Created by Will Benton on 2008-07-15.
# you probably want automatic git-gc before running this:
# git config --global 1
(cd && rsync -avz\* .)
git svn clone -s file://$(pwd)/ 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:
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:
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
// Trivial example of using virtual dispatch to hide template parameters from clients, as
// alluded to here:
#include <iostream>
#include <list>
#include <tr1/memory>
class repr {
virtual ~repr() { }