Skip to content

Instantly share code, notes, and snippets.

View allen-munsch's full-sized avatar
⁉️

James allen-munsch

⁉️
View GitHub Profile
@indygreg
indygreg / find_old_lines.pl
Created June 17, 2012 20:17
Find oldest lines in git repository
#!/usr/bin/perl
# This script parses Git blame's "porcelain" output format and
# ascertains the oldest lines of code seen.
#
# If you want to perform a custom report, just define your own callback
# function and invoke parse_porcelain() with it.
#
# The expected input format is slightly modified from raw `git blame
# -p`. Here is an example script for producing input:
@mdbecker
mdbecker / gist:1309633
Created October 24, 2011 17:50
multiprocess && gevent example
from multiprocessing import Pool as MPool
from time import sleep
import datetime
import multiprocessing
import random
def time_request():
from gevent import monkey; monkey.patch_socket
from jsonrequester import JsonRequester
@proppy
proppy / depy.sh
Created August 10, 2011 12:49
depy: hack to vendor a python library and its dependencies
set -e
[ $# -ge 2 ] || (echo 'usage: depy PACKAGES... DIRECTORY' ; false)
PACKAGES=${@:1:$(($#-1))}
DESTINATION=${!#}
TMPDIR=/tmp/depy.$$
pip install -E $TMPDIR $PACKAGES
find $TMPDIR -type f -name "*.pyc" -delete
PACKAGES=$(pip freeze -E $TMPDIR | cut -d '=' -f 1 | xargs -n 1 -I @package@ find $TMPDIR -ipath '*/@package@/__init__.py' | sed -e s/__init__\.py//)
mkdir -p $DESTINATION
cp -R $PACKAGES $DESTINATION