Skip to content

Instantly share code, notes, and snippets.

View bgamari's full-sized avatar

Ben Gamari bgamari

View GitHub Profile
@osa1
osa1 / analyse_cabal_log.py
Last active March 29, 2016 09:08
A little Python script to analyze Cabal logs and generate timing info of modules
import re
import sys
TIMING_RE = re.compile(r"^!!! (.+) \[(.*)\]: .* (\d+\.\d+) milliseconds, .* (\d+\.\d+) megabytes")
def sort_cmp_time(v1, v2):
return cmp(v1[1][0], v2[1][0])
def sort_cmp_alloc(v1, v2):
return cmp(v1[1][1], v2[1][1])
@goldfirere
goldfirere / Basics.hs
Created January 30, 2016 19:34
TypeRep tomfoolery
{-# LANGUAGE TypeOperators, TypeFamilies, TypeApplications,
ExplicitForAll, ScopedTypeVariables, GADTs, TypeFamilyDependencies,
TypeInType, ConstraintKinds, UndecidableInstances,
FlexibleInstances, MultiParamTypeClasses, FunctionalDependencies,
FlexibleContexts, StandaloneDeriving, InstanceSigs #-}
module Basics where
import Data.Type.Bool
import Data.Type.Equality
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32"
target triple = "arm-unknown-linux-gnueabi"
declare ccc i8* @memcpy(i8*, i8*, i32)
declare ccc i8* @memmove(i8*, i8*, i32)
declare ccc i8* @memset(i8*, i32, i32)
declare ccc i32 @newSpark(i8*, i8*)
!0 = metadata !{metadata !"top", i8* null}
!1 = metadata !{metadata !"stack", metadata !0}
!2 = metadata !{metadata !"heap", metadata !0}
!3 = metadata !{metadata !"rx", metadata !2}
@planbnet
planbnet / gnome-terminal-zenburn.sh
Created December 2, 2011 09:12
Zenburn color scheme for gnome-terminal
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################