Skip to content

Instantly share code, notes, and snippets.

@hverr
hverr / hporder
Created April 18, 2018 11:11
Order GHC heap profiles
#!/usr/bin/env python
import fileinput
class Sample(object):
def __init__(self, start_line):
_, time = line.split(' ')
self.time = float(time)
self.lines = [start_line]
@hverr
hverr / prepare-commit-msg.sh
Last active September 8, 2015 15:29
Git hook to prepend the issue number to the commit message
#!/bin/sh
exec < /dev/tty
detect_issue() {
local branch="$(git branch | grep '^\*' | sed 's/^\* //')"
local issue=$(echo "$branch" | grep -o '[0-9][0-9]*' | head -n 1)
if [ -z "$issue" ]; then
return 1
fi