Skip to content

Instantly share code, notes, and snippets.

@vlandham
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
#!/usr/bin/ruby
#
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master 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
vlandham / gist:1214151
Created Sep 13, 2011 — forked from caged/gist:1173725
d3.js experiment - Donuts, Bars and Crime.
View gist:1214151
#
# CoffeeScript for http://dealloc.me/demos/crime/2011.html
# Copyright (c) 2011 Justin Palmer <http://github.com/Caged>
# LICENSE: http://www.opensource.org/licenses/mit-license.php
$ ->
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
@vlandham
vlandham / index.html
Created Mar 7, 2012 — forked from jasondavies/README.md
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<!--
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, http://dillingham.me.uk/
-->
<title>Zoom/pan map example</title>
<script type="text/javascript" src="https://raw.github.com/mbostock/d3/master/d3.v2.min.js"></script>
@vlandham
vlandham / README.md
Created Mar 19, 2012 — forked from mbostock/.block
Force Layout with Multiple Foci
View README.md

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
vlandham / _.md
Created Sep 12, 2012 — forked from enjalot/_.md
just another inlet to tributary
@vlandham
vlandham / _.md
Created Sep 12, 2012 — forked from enjalot/_.md
just another inlet to tributary
@vlandham
vlandham / geodesic.js
Created Oct 12, 2012 — forked from mbostock/.block
Geodesic Grid
View geodesic.js
(function() {
var φ = 1.618033988749895,
ρ = 180 / Math.PI;
var vertices = [
[1,φ,0], [-1,φ,0], [1,-φ,0], [-1,-φ,0],
[0,1,φ], [0,-1,φ], [0,1,-φ], [0,-1,-φ],
[φ,0,1], [-φ,0,1], [φ,0,-1], [-φ,0,-1]
];
@vlandham
vlandham / index.html
Created Nov 7, 2012 — forked from mbostock/.block
move letters
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: bold 100px monospace;
cursor: move;
}
.enter {
@vlandham
vlandham / index.html
Created Nov 29, 2012 — forked from mbostock/.block
Satellite Projection
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.graticule {
fill: none;
stroke: #777;
}
.boundary {