This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, datetime, subprocess | |
churn = {} # lines per date | |
# get a list of tracked files | |
git = subprocess.Popen(("git","ls-files"),stdout=subprocess.PIPE) | |
files = git.communicate()[0].strip().split("\n") | |
if git.returncode: sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><title>test.py</title> | |
<style> | |
.v { font-weight: bold; color: navy; } | |
.error { font-weight: bold; color: yellow; background-color: red; } | |
.unused { font-weight: light; color: darkgray; } | |
</style> | |
<script type="text/javascript"> | |
var highlight = {}; | |
function clear_highlight() { | |
for(var id in highlight) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
<!-- | |
function onkey(event) { | |
if(event.target.id == "b") { | |
var c = document.getElementById("c"); | |
if(!c) { | |
document.getElementById("a").innerHTML += "<br/><input id=\"c\" type=\"text\"/>"; | |
c = document.getElementById("c"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import array | |
# these routines copied shamelessly from http://threeblindmiceandamonkey.com/?p=16 | |
# multiply matrix: c = a * b | |
cdef inline void multiplyMatrix(double a[3][3], double b[3][3], double c[3][3]): | |
c[0][0] = a[0][0]*b[0][0] + a[0][1]*b[1][0] + a[0][2]*b[2][0] | |
c[0][1] = a[0][0]*b[0][1] + a[0][1]*b[1][1] + a[0][2]*b[2][1] | |
c[0][2] = a[0][0]*b[0][2] + a[0][1]*b[1][2] + a[0][2]*b[2][2] | |
c[1][0] = a[1][0]*b[0][0] + a[1][1]*b[1][0] + a[1][2]*b[2][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Will's quick mandelbulb GLSL</title> | |
<script type="application/javascript"> | |
var canvas, gl, program; | |
function start() { | |
window.onerror = function(msg, url, lineno) { | |
alert(url + '(' + lineno + '): ' + msg); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createOrtho2D(left,right,top,bottom) { | |
var near = -1, far = 1, rl = right-left, tb = top-bottom, fn = far-near; | |
return [2/rl,0,0,0, | |
0,2/tb,0,0, | |
0,0,-2/fn,0, | |
-(right+left)/rl, -(top+bottom)/tb, -(far+near)/fn,1]; | |
} | |
createOrtho2D(0,canvas.offsetWidth,0,canvas.offsetHeight) * [10,10,0] = [-0.9804878048598766,0.9450549436733127,0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, subprocess, base64 | |
import tornado.ioloop | |
import tornado.web | |
from tornado.options import define, options, parse_command_line | |
define("port",default=8888,type=int) | |
define("branch",default="master") | |
define("access",type=str,multiple=True) | |
class MainHandler(tornado.web.RequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[I 120826 17:42:18 web:1447] 304 GET /index.html (127.0.0.1) 21.74ms | |
[I 120826 17:42:19 web:1447] 304 GET /game.js (127.0.0.1) 27.38ms | |
[I 120826 17:42:19 web:1447] 304 GET /glutil.js (127.0.0.1) 15.00ms | |
[I 120826 17:42:19 web:1447] 304 GET /ui.js (127.0.0.1) 30.35ms | |
[I 120826 17:42:19 web:1447] 304 GET /g3d.js (127.0.0.1) 17.36ms | |
[I 120826 17:42:19 web:1447] 304 GET /logo.jpg (127.0.0.1) 11.59ms | |
[I 120826 17:42:19 web:1447] 304 GET /bitstream_vera_sans.png (127.0.0.1) 9.04ms | |
[I 120826 17:42:19 web:1447] 304 GET /bitstream_vera_sans.xml (127.0.0.1) 12.62ms | |
[I 120826 17:42:19 web:1447] 304 GET /grid.png (127.0.0.1) 9.49ms | |
[I 120826 17:42:19 web:1447] 304 GET /fighter2.g3d (127.0.0.1) 13.74ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, struct, datetime | |
fmts = ("b","<h",">h","<H",">H","<i",">i","<I",">I","<f",">f","<d",">d") | |
s = file(sys.argv[1],"r").read() | |
print sys.argv[1] | |
print "ofs,",", ".join(fmts) | |
for i in xrange(len(s)-8): | |
print "%d,"%i,", ".join("%s"%struct.unpack(fmt,s[i:i+struct.calcsize(fmt)])[0] for fmt in fmts), | |
print "'%s',"%datetime.datetime.fromtimestamp(struct.unpack("<I",s[i:i+4])[0]).strftime('%Y-%m-%d %H:%M:%S'), | |
print "'%s'"%datetime.datetime.fromtimestamp(struct.unpack(">I",s[i:i+4])[0]).strftime('%Y-%m-%d %H:%M:%S') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<kml xmlns="http://earth.google.com/kml/2.2"> | |
<Document> | |
<name>Collar9007</name> | |
<description>GPS Plus - http://www.vectronic-aerospace.com</description> | |
<Style id="FirstFix"> | |
<IconStyle> | |
<Icon> | |
<href>http://maps.google.com/mapfiles/kml/shapes/square.png</href> | |
</Icon> |