Skip to content

Instantly share code, notes, and snippets.

@sdjacobs
sdjacobs / get-french-unigrams.py
Created December 4, 2014 18:15
Get count of all French unigrams in the Google Books corpus
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from google_ngram_downloader import readline_google_store
all_records = readline_google_store(ngram_len=1, lang="fre")
this_ngram = "WORDS"
this_count = "COUNT"
for (fname, url, records) in all_records:
@sdjacobs
sdjacobs / d3.mapzoom.js
Last active August 29, 2015 14:13
Putting Dijkstra's algorithm on the map
d3.mapzoom = function() {
var center = [0,0]
var scale = 10000
var projection = undefined,
zoom = undefined,
tile = undefined
var layers = []
@sdjacobs
sdjacobs / index.html
Last active August 29, 2015 14:13 — forked from mbostock/.block
Finding the Key Players in a graph
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.link {
@sdjacobs
sdjacobs / index.html
Last active July 18, 2016 16:08
OTP client
<!DOCTYPE html>
<html>
<head>
<title>OTP</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
</head>
@sdjacobs
sdjacobs / index.html
Last active September 12, 2016 17:00
number example
Pick a number <input type="number" pattern="\d*"/></input> <br>
Telephone number: <input type="tel"></input>
@sdjacobs
sdjacobs / # qgis - 2016-10-07_12-04-34.txt
Created October 7, 2016 17:02
qgis (homebrew/science/qgis) on macOS 10.10.5 - Homebrew build logs
Homebrew build logs for homebrew/science/qgis on macOS 10.10.5
Build date: 2016-10-07 12:04:34
@sdjacobs
sdjacobs / README.md
Last active April 18, 2017 15:20
Divvy Trips in Hyde Park

This visualization illustrates the use of a chord diagram. It's based on Mike Bostock's visualization of Uber data, and makes use of data made available by Divvy here.

This shows the origins and destinations of Divvy bikeshare trips in Hyde Park. The arcs represent origins and destinations, and the chords represent trips. Hover over the arcs to see what Divvy stations they represent. Hover over the chords to see magnitude in each direction.

4/18/2017 - the following links are dead

A larger version of this visualization is here.

I created this visualization as an example in my D3 workshop.

@sdjacobs
sdjacobs / Senior_Centers.csv
Last active January 26, 2018 21:32
D3 mapzoom: Senior centers in Chicago
PROGRAM SITE NAME HOURS OF OPERATION ADDRESS CITY STATE ZIP PHONE LOCATION
Regional Senior Center Northeast Mon - Fri 8:30 a.m. to 4:30 p.m. Sat 9:00 a.m. to 4:00 p.m. 2019 W. Lawrence Avenue Chicago IL 60625 312-744-0784 2019 W. Lawrence Avenue Chicago, IL 60625 (41.96872254686461, -87.68019238203728)
Regional Senior Center Southwest Mon - Fri 8:30 a.m. to 4:30 p.m. Sat 9:00 a.m. to 4:00 p.m. 6117 S. Kedzie Avenue Chicago IL 60629 312-747-0440 6117 S. Kedzie Avenue Chicago, IL 60629 (41.78212991978889, -87.70319764951621)
Regional Senior Center Northwest Mon - Fri 8:30 a.m. to 4:30 p.m. Sat - Sun 9:00 a.m. to 4:00 p.m 3160 N. Milwaukee Avenue Chicago IL 60618 312-744-6681 3160 N. Milwaukee Avenue Chicago, IL 60618 (41.938368983472756, -87.72268832479132)
@sdjacobs
sdjacobs / config.js
Created February 5, 2018 16:22
config.js for otp-vtrans-ui
window.OTP_config = {
initLatLng: [44.42, -72.01],
osmMapKey: 'your-mapbox-key',
aerialMapKey: 'your-mapbox-aerial-key',
// geocoderSearchRadius : 25, // search radius in km for mapzen geocoder from initLatLng (defaults to 50 if not specified)
// change to server where you are running OTP
otpApi: '/otp/routers/',
@sdjacobs
sdjacobs / .block
Last active January 12, 2019 21:48 — forked from mbostock/.block
World Tour
license: gpl-3.0