Skip to content

Instantly share code, notes, and snippets.

# Maintainer: Daniel Nagy <danielnagy at gmx de>
_hkgname=json
pkgname=haskell-json
pkgver=0.9.1
pkgrel=1
pkgdesc="Support for serialising Haskell to and from JSON"
url="http://hackage.haskell.org/package/${_hkgname}"
license=(custom:BSD3)
arch=('i686' 'x86_64')
@richq
richq / doit.py
Created June 28, 2011 18:44
Script to massage the output of the data to js format
#!/usr/bin/env python
lines = open("data.txt").readlines()
total = 0
cnt = 1
print '{\n "values": {'
for marker in lines[1].split():
name = lines[0][total:total + len(marker)].strip()
val = lines[2][total:total + len(marker)].strip()
print ' "%s": %2.2f,' % (name, float(val))
@richq
richq / lint.py
Created February 11, 2011 16:52
SCons lint tool
import SCons.Defaults
import SCons.Builder
OriginalShared = SCons.Defaults.SharedObjectEmitter
OriginalStatic = SCons.Defaults.StaticObjectEmitter
def DoLint(env, source):
for s in source:
env.Lint(s.srcnode().path + ".lint", s)
@richq
richq / extract.scala
Created November 24, 2009 20:09
Scala script to download a bunch of crap from a web page
#!/bin/sh
exec scala -deprecation -savecompiled "$0" "$@"
!#
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStream;
import java.io.IOException;
import java.net.URL;
import java.util.regex.Pattern;
@richq
richq / get.sh
Created November 5, 2009 19:39
script to download mp3s from podiobooks.com
#!/bin/sh
# script to download mp3s from podiobooks.com
wget $1 -O index.html
awk '/http:\/\/.*mp3/ {print}' index.html | sed 's%.*\(http://.*\.mp3\).*%\1%g' |\
while read line
do
filename=$(basename $line)
@richq
richq / eclipse_cdt.py
Created October 16, 2009 18:33
Eclipse CDT 5.0 generator for Waf http://code.google.com/p/waf/
# Eclipse CDT 5.0 generator for Waf http://code.google.com/p/waf/
# New BSD License
import sys
import os
import Utils
import Logs
from Constants import APPNAME
from xml.dom.minidom import Document
import Options
@richq
richq / .bashrc
Created January 15, 2009 19:30 — forked from mernen/.bashrc
with current PS1
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null
[[ $? == 1 ]] && echo "*"
}
function parse_git_branch {