Skip to content

Instantly share code, notes, and snippets.

vlandham / install_homebrew.rb
Created Jun 2, 2011 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
View install_homebrew.rb
# This script installs to /usr/local only. To install elsewhere you can just
# untar anywhere you like.
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
# versions of OS X. I cannot verify that for sure, and it was tested on
vlandham / gist:1214151
Created Sep 13, 2011 — forked from caged/gist:1173725
d3.js experiment - Donuts, Bars and Crime.
View gist:1214151
# CoffeeScript for
# Copyright (c) 2011 Justin Palmer <>
$ ->
hash = document.location.hash
year = if hash then hash.replace('#', '') else 2011
[pt,pl,pb,pr] = [35, 20, 20, 20]
w = (900 - (pl + pr)) / 2
h = w
View parse_interviews.rb
#!/usr/bin/env ruby
require 'yaml'
require 'json'
input_dirname = ARGV[0]
output_filename = "parsed_interviews.json"
class Categorizer
HW_CATEGORIES = [[/.*dell.*/, ["pc","system"]],
View gist:1609839
<% list = [
"Sarang Sane, University of Kansas",
"Alessandro De Stefani, University of Kansas",
"Arindam Banerjee, University of Kansas",
"Jason Lutz, University of Nebraska - Lincoln",
"Luigi Ferraro, University of Nebraska - Lincoln",
"Kat Shultis, University of Nebraska - Lincoln"
] %>
<% sorted_list = list.sort {|a,b| a.split(" ")[0].downcase <=> b.split(" ")[0].downcase } %>
vlandham / index.html
Created Mar 7, 2012 — forked from jasondavies/
Zoom/pan map example: integrates d3.geo with d3.behavior with the aim of producing a map that can be panned and zoomed.
View index.html
<html lang="en">
Zoom/pan map example: integrates d3.geo with d3.behavior with the aim of
producing a map that can be panned and zoomed.
Iain Dillingham,
<title>Zoom/pan map example</title>
<script type="text/javascript" src=""></script>
vlandham /
Created Mar 19, 2012 — forked from mbostock/.block
Force Layout with Multiple Foci

Click to perturb or drag the nodes!

This example demonstrates the flexibility of D3's force layout. By using position Verlet integration, it is easy to add custom forces to a layout. In this example, the nodes are clustered around four foci using additional forces: the odd nodes are pushed down, the even nodes are pushed up, and a similar bisecting force is applied laterally. These custom forces are based purely on the index of the node, but they could just as easily be derived from properties of data!

vlandham / short.css
Created Apr 5, 2012
Street Map Styling for TileMill
View short.css
//short version
@minor_color: #1d1d1d;
@major_color: #000;
#roads {
line-join: round;
line-cap: round;
View index.html
<!doctype html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link href=',400,700' rel='stylesheet' type='text/css'>
<script src="raphael-min.js"></script>
<script src=""></script>
View simple_bubble.js
$(document).ready(function() {