Skip to content

Instantly share code, notes, and snippets.

View afternoon's full-sized avatar

Ben Godfrey afternoon

View GitHub Profile
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<switches>
<add name="ShowErrors" value="4"/>
</switches>
<!-- log to debug output -->
<sources>
@afternoon
afternoon / rrdxml.py
Created April 28, 2011 20:45
Dump RRD XML to CSV
#!/usr/bin/env python
"""Export CSV from an RRD XML dump.
Usage: rrdxml.py file.xml rra
Where rra is the 0-based index for the RRA you want to dump.
"""
from csv import writer
from itertools import chain, izip
@afternoon
afternoon / org.fitnesse.plist
Created May 12, 2011 10:17
Launchd plist for FitNesse acceptance testing tool
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.fitnesse</string>
<key>ServiceDescription</key>
<string>FitNesse Acceptance Tests</string>
<key>ProgramArguments</key>
<array>
@afternoon
afternoon / date_popup_no_jquery_ui_module.patch
Created May 16, 2011 17:12
Remove requirement for jquery_ui module from date_popup in Drupal date module (make sure you drupal_add_js("jquery-ui.min.js"))
diff --git date_popup/date_popup.module date_popup/date_popup.module
index 513aace..6111004 100644
--- date_popup/date_popup.module
+++ date_popup/date_popup.module
@@ -29,9 +29,6 @@ function date_popup_load() {
return;
}
$path = drupal_get_path('module', 'date_popup');
- if (module_exists('jquery_ui')) {
- jquery_ui_add('ui.datepicker');
@afternoon
afternoon / git-sync
Created July 8, 2011 15:04
Sync with a git remote, using git-up if available, pull --rebase if not
#!/bin/sh
changed=`git status -s | wc -l`
if [[ "$changed" -gt "0" ]]; then
echo "\033[31mCan't sync: working tree dirty\033[0m"
else
repo=${1:-origin}
if which -s git-up; then
git up $repo
else
git pull --rebase $repo
@afternoon
afternoon / rki_query.py
Created October 2, 2011 22:22
Scrape disease data from RKI SurvStat
#!/usr/bin/python
# vim: set fileencoding=utf-8
from csv import writer
from datetime import datetime
from selenium import webdriver
COUNTIES = [
(5334, 'SR Aachen'),
@afternoon
afternoon / tartetatin.dot
Created October 31, 2011 23:34
Recipe For Tarte Tatin Represented As A Directed Acyclic Graph
digraph tartetatin {
node [fontname=Helvetica, shape=rect];
// ingredients
{
node [color=gray, style=filled];
butter; sugar; water; apple; rosemary; pastry;
}
// temps
@afternoon
afternoon / git-slim.py
Created December 5, 2011 14:42
Remove large objects from a git repository
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/
@afternoon
afternoon / helloworld.scala
Created February 5, 2012 20:23
Unfiltered Hello World
import unfiltered.filter._
import unfiltered.request._
import unfiltered.response._
class HelloWorldApp extends Plan {
def intent = {
case GET(Path("/")) =>
PlainTextContent ~> ResponseString("Hello, world!")
}
}
@afternoon
afternoon / go.xsd
Created February 13, 2012 22:36
XML Schema for Go Feeds API
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.thoughtworks-studios.com/ns/go">
<xs:element name="pipelines">
<xs:complexType>
<xs:sequence>
<xs:element ref="link"/>
<xs:element ref="pipeline"/>
</xs:sequence>
</xs:complexType>
</xs:element>