Skip to content

Instantly share code, notes, and snippets.

@ttscoff
ttscoff / planter.rb
Created September 22, 2012 17:57
Create directory trees from indented text input
#!/usr/bin/ruby
=begin
Planter v1.3
Brett Terpstra 2013
ruby script to create a directory structure from indented data.
Three ways to use it:
- Pipe indented (tabs or 2 spaces) text to the script
- e.g. `cat "mytemplate" | planter.rb
- Create template.tpl files in ~/.planter and call them by their base name
@ttscoff
ttscoff / matrixish.sh
Created September 15, 2012 18:23
A Matrix-ish display for Bash terminal
#!/bin/bash
#
# matrix: matrix-ish display for Bash terminal
# Author: Brett Terpstra 2012 <http://brettterpstra.com>
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/>
#
# A morning project. Could have been better, but I'm learning when to stop.
### Customization:
blue="\033[0;34m"
@mechanicalgirl
mechanicalgirl / redvblue_public
Created August 28, 2012 18:01
Playing around with the Sunlight Labs 'openstate' API
"""
This script pulls from the Sunlight Labs "openstates" API
to get information about legislators at the state level,
do a count of their party affiliations,
and return that information as
1) a JSON object for visualizations
2) a table suitable for embed into an HTML page
Information about the specific API used can be found here:
http://python-sunlight.readthedocs.org/en/latest/services/openstates.html
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: