This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"draft": false, | |
"layers": [ | |
{ | |
"id": "background", | |
"type": "background", | |
"layout": {}, | |
"paint": { | |
"background-color": "hsl(55, 1%, 20%)" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CORRECTIONS = { | |
"Stanislaus, CA": "Stanislaus County, CA", | |
"Monmouth, NJ": "Monmouth County, NJ", | |
"Stark, OH": "Stark County, OH", | |
"Bon Homme, SD": "Bon Homme County, SD", | |
"Orleans, LA": "Orleans Parish, LA", | |
"Ventura, CA": "Ventura County, CA", | |
"Jefferson, CO": "Jefferson County, CO", | |
"Pottawattamie, IA": "Pottawattamie County, IA", | |
"Nassau, FL": "Nassau County, FL", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Earth has a mean radius of 6,371km | |
const R = 6371.01; | |
const EPSILON = 0.0000001; | |
function toRadians(degree) { | |
return (degree * Math.PI) / 180; | |
} | |
function toDegrees(radians) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydeck | |
# 2014 locations of car accidents in the UK | |
UK_ACCIDENTS_DATA = ('https://raw.githubusercontent.com/uber-common/' | |
'deck.gl-data/master/examples/3d-heatmap/heatmap-data.csv') | |
# Define a layer to display on a map | |
layer = pydeck.Layer( | |
'HexagonLayer', | |
UK_ACCIDENTS_DATA, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bundle = (function (exports, core, d3Dsv) { | |
'use strict'; | |
// TODO - can we reuse the core util? Assuming we don't want to export it | |
/* eslint-disable complexity */ | |
// Compares two objects to see if their keys are shallowly equal | |
function shallowEqualObjects(a, b) { | |
if (a === b) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OBJECTID | TOWN | FIPS_CODE | TOWN_ID | TYPE | FIPS_STCO | SUM_SQUARE_MILES | POP2010 | ORIGIN_TRIPS | PCT_ORIGIN_TRIPS | DESTINATION_TRIPS | PCT_DESTINATION_TRIPS | ORIGIN_TRIPS_PER_PERSON | DESTINATION_TRIPS_PER_PERSON | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
151 | ABINGTON | 2502300170 | 1 | T | 25023 | 10.19 | 15985 | 29620 | 0.04571 | 29665 | 0.04578 | 1.85 | 1.86 | |
144 | ACTON | 2501700380 | 2 | T | 25017 | 20.295 | 21924 | 17645 | 0.02723 | 18998 | 0.02932 | 0.8 | 0.87 | |
62 | ACUSHNET | 2500500520 | 3 | T | 25005 | 18.878 | 10303 | 673 | 0.00104 | 891 | 0.00138 | 0.07 | 0.09 | |
20 | ADAMS | 2500300555 | 4 | T | 25003 | 22.96 | 8485 | 66 | 0.0001 | 113 | 0.00017 | 0.01 | 0.01 | |
2 | AGAWAM | 2501300840 | 5 | TC | 25013 | 24.335 | 28438 | 20918 | 0.03228 | 20672 | 0.0319 | 0.74 | 0.73 | |
155 | ALFORD | 2500300975 | 6 | T | 25003 | 11.533 | 494 | 1 | 0 | 3 | 0 | 0 | 0.01 | |
16 | AMESBURY | 2500901260 | 7 | C | 25009 | 13.725 | 16283 | 9984 | 0.01541 | 9210 | 0.01421 | 0.61 | 0.57 | |
351 | AMHERST | 2501501325 | 8 | T | 25015 | 27.754 | 37819 | 284506 | 0.43907 | 282307 | 0.43567 | 7.52 | 7.46 | |
179 | ANDOVER | 2500901465 | 9 | T | 25009 | 32.153 | 33201 | 85159 | 0.13142 | 90416 | 0.13953 | 2.56 | 2.72 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import math | |
from Queue import Queue | |
import sys | |
from threading import Thread | |
import time | |
import requests | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yoman: Yo for the Terminal | |
==================== | |
[Get an API token and a username](https://medium.com/@YoAppStatus/yo-developers-api-e7f2f0ec5c3c), and send yourself a [Yo](http://www.justyo.co/) when your script raps up. | |
Sub your username and API key in below. Copy and paste it into your .bashrc. | |
``` | |
function yoman () { | |
eval "$@" |