Skip to content

Instantly share code, notes, and snippets.

View thraxil's full-sized avatar

Anders Pearson thraxil

View GitHub Profile
@thraxil
thraxil / gist:3239180
Created August 2, 2012 18:00
goldap interface test
package main
import (
"github.com/jmckaskill/goldap"
"fmt"
"os"
)
func printer (r string) {
fmt.Println("out!")
@thraxil
thraxil / gist:3218950
Created July 31, 2012 17:58
my ~/.jshint
{
"asi" : true,
"bitwise" : true,
"boss" : false,
"browser" : true,
"couch" : true,
"curly" : true,
"debug" : false,
"devel" : true,
"eqeqeq" : true,
@thraxil
thraxil / gist:3123935
Created July 16, 2012 17:35
django project git pre-commit hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
@thraxil
thraxil / mod7.go
Created May 1, 2012 15:01
simple implementation of the mod 7 graph walking algorithm
// simple implementation of the mod 7 algorithm described here:
// http://blog.tanyakhovanova.com/?p=262
// compile with "go build mod7.go"
// then:
//
// $ echo 1098712349087123409871234908712340917823490187234091827340918273490128734 | ./mod7
// 1
//
// time echo 1098712349087123409871234908712340917823490187234091827340918273490128734 | ./mod7
@thraxil
thraxil / gist:1718994
Created February 1, 2012 19:59
cachebuster bookmarklet
javascript:window.location=window.location.href+(window.location.href.indexOf("?")==-1?"?":"&")+"__cachebuster="+parseInt(Math.random()*99999999);
@thraxil
thraxil / gist:881707
Created March 22, 2011 18:08
logarithmic scaling of tag clouds
#!/usr/bin/env python
import math
tags = [('admin', 1), ('annotation', 1), ('annotations', 6), ('apache', 1),
('authentication', 2), ('backend', 27), ('caching', 1), ('cgi_app', 1),
('cherrypy', 1), ('cherrypy-branch', 2), ('client', 3), ('cookies', 1),
('CSS', 2), ('dependencies', 4), ('documentation', 8), ('email', 8),
('exif', 1), ('fields', 4), ('flash', 2), ('forum', 3), ('fozzy', 1),
('frink', 1), ('groups', 3), ('HTML', 2), ('items', 29),