Skip to content

Instantly share code, notes, and snippets.

@mbostock
mbostock / .block
Last active March 8, 2024 10:40
geo2svg
license: gpl-3.0
height: 1100
border: no
@d3noob
d3noob / .block
Last active May 24, 2023 03:23
Collapsible tree diagram in v4
license: mit
@mbostock
mbostock / .block
Last active April 3, 2020 20:15
Scatterplot Tour
license: gpl-3.0
height: 600
redirect: https://observablehq.com/@d3/scatterplot-tour
@mbostock
mbostock / .block
Last active September 30, 2016 16:15
Reprojecting CSV with ogr2ogr
license: gpl-3.0
@caged
caged / .gitignore
Last active February 26, 2022 23:33
US Federal Judicial Districts
.DS_Store
node_modules
us-judicial-districts.zip
build
@d3noob
d3noob / .block
Last active January 13, 2022 23:01
Tree diagram with node images
license: mit
@mbostock
mbostock / .block
Last active October 31, 2017 22:24
Mexico
license: gpl-3.0
@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
@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
}
@jeffcogswell
jeffcogswell / q_example.js
Last active August 12, 2022 01:22
Here's another chaining example on using q.js. This doesn't have any error handling, as I just want to demonstrate the chaining concept. Please read the comments carefully, as I start out with a non-q example, to show the order of flow. Please post comments if there's anything that isn't clear and I'll try to revise it as needed.
// Q sample by Jeff Cogswell
/*===========
We want to call these three functions in sequence, one after the other:
First we want to call one, which initiates an ajax call. Once that
ajax call is complete, we want to call two. Once two's ajax call is
complete, we want to call three.
BUT, we don't want to just call our three functions in sequence, as this quick