Skip to content

Instantly share code, notes, and snippets.

@tgs
tgs / psalm-104-parker.txt
Created February 7, 2014 16:38
Matthew Parker's English translation of Psalm 104, published 1650.
Psalm 104
Translated by
Matthew Parker (1504-1575), Archbishop of Canterbury
The Argument. Psalme. CIIII.
This Psalme setth out: for prouidence,
Almighty Gods: magnificence:
His wisdome, power: his goodnes eke,
Of night, of day: of yere, of weeke,
His excellence: all thyng doth kepe.
@tgs
tgs / README.md
Last active August 29, 2015 14:00
Fun twiddly lines

Click it to make it go again.

A d3.js version of the "egyptian" effect used in Tron. A few really fun pages over here by GMUNK were the inspiration.

@tgs
tgs / README.md
Last active August 29, 2015 14:01
Star thingy

Zing, pow

Click it to make it go some more

@tgs
tgs / Vagrantfile
Last active August 29, 2015 14:04
Vagrantfile for developing edx/configuration
Vagrant.require_version ">= 1.5.3"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
VAGRANTFILE_API_VERSION = "2"
MEMORY = 2048
CPU_COUNT = 3
@tgs
tgs / problemo.py
Last active August 29, 2015 14:09 — forked from anonymous/problemo.py
#!/usr/bin/env python
#
# Half-assed fuzzer for HTML strip-tags functions
#
from __future__ import print_function
BITS = [
'<', '</', '>', '<!--', '-->', 'a', 'div', 'p', 'i',
]
@tgs
tgs / gitignore.py
Created April 1, 2015 21:00
py.test: ignore the same files as git when doing test collection
import subprocess
# Usage: put it in the current directory, and run
# py.test -p gitignore [...]
def pytest_ignore_collect(path, config):
if path.basename == '.git': # Ignore .git directory
return True
child = subprocess.Popen(['git', 'check-ignore', str(path)],
@tgs
tgs / hist_summary.r
Created May 26, 2015 22:20
Add median to ggplot2 histogram
library(proto)
library(ggplot2)
stat_hist_summary <- function (mapping = NULL, data = NULL, geom = "vline", position = "identity",
fun = median, ...) {
StatHistSummary$new(mapping = mapping, data = data, geom = geom,
position = position, fun = fun, ...)
}
StatHistSummary <- proto(ggplot2:::Stat, {
@tgs
tgs / MissingBundleComplainer.java
Created December 6, 2011 20:51
Complain about ".tests" bundles that aren't activated
package org.cishell.testcollector;
import java.io.File;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.tap4j.model.Plan;
@tgs
tgs / MANIFEST.MF
Created February 10, 2012 14:49
Demo of a bug in Tycho staged 0.14.0, version checking is stricter than auto version updating
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: manifest-version-bug
Bundle-SymbolicName: manifest-version-bug
Bundle-Version: 1
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
@tgs
tgs / funproxy.py
Created November 25, 2015 06:18
see hidden areas in xkcd 1608 - requires bottle.py, PIL(low), numpy
#!/usr/bin/env python
import StringIO
import numpy as np
from bottle import route
from bottle import run
from bottle import abort
import Image
import requests