Skip to content

Instantly share code, notes, and snippets.

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),
@mbostock
mbostock / .block
Last active February 26, 2019 22:32
Voronoi Labels
redirect: https://observablehq.com/@mbostock/d3-voronoi-labels
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.background {
fill: none;
pointer-events: all;
}
#states {
@scotthmurray
scotthmurray / DataJournalismJobs.md
Last active July 13, 2019 18:19
Ideas for where to post and publicize open data journalism positions

Where to Post your Data Journalism Jobs

Update: This has moved. An updated and maintained version is here: http://alignedleft.com/resources/data-vis-jobs

I posed this question on Twitter:

If you wanted to hire a “data journalist” to support an existing reporting team with data parsing + vis, how would you find that person?

I've documented the responses here. Basically, there seems to be only one job site specifically for data journalists (so far!), and several others, depending on which audience you want to reach (e.g., more focused on development, data vis, or journalism).

@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
@davewalk
davewalk / gist:5893611
Last active June 15, 2018 18:58
Using Stamen map tiles in Leaflet without loading the tile.stamen.js file
var tonerUrl = "http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png";
var url = tonerUrl.replace(/({[A-Z]})/g, function(s) {
return s.toLowerCase();
});
var basemap = L.tileLayer(url, {
subdomains: ['','a.','b.','c.','d.'],
minZoom: 0,
maxZoom: 20,

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

@mbostock
mbostock / .block
Last active May 22, 2022 00:36
Every ColorBrewer Scale
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-color-schemes
@mbostock
mbostock / .block
Last active February 9, 2016 02:07
GeoJOIN
license: gpl-3.0
@lobodin
lobodin / README.md
Last active March 30, 2023 06:23
Import GeoNames.org cities data to mongodb.

#Generate cities data

  1. wget http://download.geonames.org/export/dump/cities15000.zip
  2. unzip cities15000.zip
  3. node geonames.js cities15000.txt

The result is json array of cities in the following format:

{

_id: