Skip to content

Instantly share code, notes, and snippets.

@jasondavies
jasondavies / index.html
Created May 8, 2012 08:16 — forked from mbostock/.block
OMG Particles! (D3)
<!DOCTYPE html>
<meta charset="utf-8">
<title>OMG Particles!</title>
<script src="http://mbostock.github.com/d3/d3.v2.min.js?2.9.1"></script>
<style>
body {
background: #222;
}
@ns-1m
ns-1m / leaflet-button-control.js
Created June 15, 2012 09:07 — forked from ejh/leaflet-button-control.js
Leaflet control button example
// How to use it?
// OnAdd() is called when you use:
// var footButton = new L.Control.Button(footButtonOpts).addTo(map);
// It is passed the map object to which your control is being added.
// The third parameter passed to L.DomEvent.addListener is the context ('this' keyword) which
// you wish to have in the callback (second parameter).
// I still don't know how to use it.
@andrewxhill
andrewxhill / index.html
Last active December 11, 2015 02:39 — forked from anonymous/index.html
Exploding globe in D3
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Exploding world</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://libs.cartocdn.com/cartodb.js/v2/cartodb.js"></script>
<style type="text/css">
body{
@max-mapper
max-mapper / readme.md
Last active December 13, 2015 23:39
node + npm explanation from #voxel.js irc

21:57 < dook> You seem to be new to node, is that right?

21:57 < skidz> good to know... yes.. very

21:57 < skidz> but familar with JS but mostly a C# programmer

21:58 < dook> Ok so the basic premise is that to make Chrome run javascript fast, they made a JS->C++ compiler called V8

21:58 < dook> It makes JS compile into very fast, efficient code.

A simple script for joining a GeoJSON file with external properties in a CSV or TSV file; extracted from TopoJSON.

@gregrahn
gregrahn / bart-2012-salaries.tsv
Last active December 19, 2015 06:59
2012 Bart Salaries. Extracted from Public Employee Salaries Database. http://www.mercurynews.com/salaries/bay-area?Entity=Bay%20Area%20Rapid%20Transit
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 11 columns, instead of 12. in line 1.
Entity Name Title Base Overtime Other (vacation, sick, bonus, etc) Medical/Dental/Visual Employeer Contribution to Pension Employee Contribution to Pension Paid By Employer Employer Contribution to Deferred Compensation (401k) Misc Total Cost of Employment
Bay Area Rapid Transit Dugger, Dorothy General Mgr 298700 0 34500 14951 39521 23324 1869 6796 419661
Bay Area Rapid Transit Crunican, Grace General Mgr 312461 0 3846 19141 37513 17500 1869 7591 399921
Bay Area Rapid Transit Tietz, Forrest Police Sergeant 136746 111902 33921 18200 60630 156 0 1107 362662
Bay Area Rapid Transit Pangilinan, Edgardo Asst Controller 107785 0 214322 10903 13017 7650 1869 5734 361279
Bay Area Rapid Transit Lucarelli, Frank Police Lieutenant 173811 46280 33422 23364 76427 233 0 5019 358556
Bay Area Rapid Transit Collier, Roberta Asst Treasurer 33971 0 289534 1797 4072 2378 1869 4897 338518
Bay Area Rapid Transit Parker, Thomas Exec Mgr Transit System Compl 136544 0 145633 19139 16863 9923 1869 5584 335554
Bay Area Rapid Transit Ra
CREATE TABLE events (
event_name varchar(64) NOT NULL,
venue_name varchar(64),
street_addr varchar(64),
city varchar(64),
state char(2) DEFAULT 'CA',
url varchar(64),
day varchar(12),
time time,
lat numeric(10,7),
@jczaplew
jczaplew / if.js
Last active January 4, 2016 00:49
If/else
if (something === something) {
if (somethingelse === somethingelse) {
// somethingelse equals somethingelse
} else {
// somethingelse isn't equal to somethingelse
}
} else {
// something doesn't equal something
}
@e-n-f
e-n-f / tilemill2.md
Last active January 4, 2016 05:09
How to get a shapefile into TileMill 2

How to get a shapefile into TileMill 2

Getting the shapefile onto your computer

You probably already have a shapefile. If not, I downloaded one from Natural Earth:

$ curl -L -O http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip
@mbostock
mbostock / .block
Last active February 9, 2016 01:16 — forked from mbostock/.block
click-to-center
license: gpl-3.0