Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>North Pole</title>
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v2.2.0/d3.js"></script>
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v2.2.0/d3.geo.js"></script>
<style type="text/css">
svg {
@AWinterman
AWinterman / Maori DAG
Created December 11, 2011 00:44
Maori DAG for Epi final
Maori +------------> Poor/Fair Self Related Health
+ ^ ^ ^
| | | |
| Age-----+ | |
| ++ | +
@AWinterman
AWinterman / Datagate.py
Created May 30, 2012 21:01
Script to convert from csv to sqlite3
import csv
import sqlite3 as lite
import subprocess
from itertools import chain
from time import time
import sys
#import logging
#logging.basicConfig(level=logging.DEBUG)
#
@AWinterman
AWinterman / circle.r
Created July 3, 2012 16:05
bar chart in polar coordinates
G = ggplot(data = frame
, aes(x = 10
, label = New.HIV.Infections.due.to.MTCT
, y = sqrt(New.HIV.Infections.due.to.MTCT)
, fill = contribution.to.global.MTCT.burden))+
geom_bar( stat= "identity", position = "identity")
#This will make a stacked bar chart with one column, with colors determined by the contribution to the global burden.
#I'm going to map x to angle and y to radius (hence the square root above)
G = G+theme_bw()+opts(axis.text.x = theme_blank(), legend.position = "bottom", axis.ticks = theme_blank() )+coord_polar(theta = "x")
suite("name of test suite", function(require) {
var MapPicker = require('../../require/some/module')
test('test something', function() {
assert.equal(some, things)
})
})
@AWinterman
AWinterman / varsort
Created August 6, 2013 22:02
varsort.sh
#!/usr/bin/env sh
# varsort: reorder lines according to length.
cat $0 | awk '{print length($0), $0}' | sort -n | tac | cut -d' ' -f2-
@AWinterman
AWinterman / main.js
Created December 3, 2013 05:41
Asynchronous + event emitter
E = require('events').EventEmitter
function fn(ready, eventArg) {
var result = // do some async stuff with to compute result
if(/* error encountered */) {
ready(new Error)
}
ready(null, result)
}
module.exports = simple_post
var USER_AGENT = require("./user_agent")
, oauth = require("./OAuth")
, request = require("request")
, open = require("open")
, path = require("path")
, ap = require("ap")
, fs = require("fs")
for event := range clientData {
message, err := event.Encode()
if err != nil {
goto EXIT
}
_, err = fw.Write(message)
if err != nil {