Skip to content

Instantly share code, notes, and snippets.

View carbocation's full-sized avatar

James Pirruccello carbocation

View GitHub Profile
@carbocation
carbocation / tree_test.go
Last active December 16, 2015 00:49
This is a test of the binary tree / recursive template parsing example given by Rob Pike in the go-nuts mailing list. It has been updated to be compatible with go 1.0.3+, including 1.1beta2. His post can be found here: https://groups.google.com/d/msg/golang-nuts/wk5IyGzHQf8/BeWnz82qEEwJ
/*
This is a test of the binary tree / recursive template parsing example given by Rob Pike
in the go-nuts mailing list. It has been updated to be compatible with go 1.0.3+, including
1.1beta2. His post can be found here: https://groups.google.com/d/msg/golang-nuts/wk5IyGzHQf8/BeWnz82qEEwJ
Run this with `go test tree_test.go`, not with `go run`.
*/
package main
import (
@carbocation
carbocation / gist:5278173
Last active February 14, 2016 18:40
On OS X, use fswatch to automatically recompile your golang project whenever you change a file in the directory.
#!/bin/bash
# This script keeps watch on the current project and compiles it continuously as you change files.
# If there are multiple projects with the same final directory name (e.g., /proj/rad and /lib/monster/rad),
# this will kill any other similarly-named running projects' binaries, potentially leading to havoc.
# To run, install fswatch, drop this file into your project directory, make it executable, and run:
# /usr/local/bin/fswatch ./ ./continuous-compile.sh
echo "Re-compiling"
@carbocation
carbocation / nyc_teachers.R
Created January 28, 2013 04:15
An examination of NYC teacher rating data
path <- "/Users/jpirruccello/Downloads"
library(ggplot2)
library(mboost)
#Load the data
y09 <- read.csv(paste(path,"TDI_20082009_FOIL_Press_JP.txt",sep="/"),sep="\t")
y10 <- read.csv(paste(path,"TDI_20092010_FOIL_Press_JP.txt",sep="/"),sep="\t")
#Identify teachers by the following, and make a merged dataframe based on the uniqueness thereof: