Skip to content

Instantly share code, notes, and snippets.

@e-n-f
e-n-f / .block
Created May 6, 2017 18:47 — forked from sjengle/.block
Flight Paths Edge Bundling
license: gpl-3.0
height: 500
border: no
@e-n-f
e-n-f / README.md
Last active August 23, 2019 00:53 — forked from shancarter/README.md
Calculating the relative angle difference between two vectors

Here are the math-y bits, courtesy of @ch402:

// The math-y bits
var a2 = Math.atan2(source.y, source.x);

var angle = function(source, compare) {
    var cross = source.x * compare.y - source.y * compare.x;
    var sd = Math.sqrt(source.x * source.x + source.y * source.y);
    var cd = Math.sqrt(compare.x * compare.x + compare.y * compare.y);

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
@e-n-f
e-n-f / taxi.sh
Last active July 7, 2017 10:45
NYC taxi with datamaps
#!/bin/sh
for i in trip_data_*.csv.zip
do
unzip -c $i
done |
tr -d '\015' |
awk -F, '{print $12 "," $11 " 1:0"; print $14 "," $13 " 1:1"}' |
/data2/data/github/datamaps/encode -z19 -m1 -o nyc-taxi-all
@e-n-f
e-n-f / armed-forces-song-folio.csv
Last active April 10, 2017 22:40
Armed Forces Song Folio songs and dates
year month title copyright key
1949 6 Again 1948 G
Once and for always 1948 C
Love me! Love me! Love me! 1947 G
If you stub your toe on the moon 1948 G
It's a cruel cruel world 1949 Eb
Lady of Spain 1931 C
Scalawag 1948 C
After you've gone 1918 C
1951 10 Because of you 1940 Eb
@e-n-f
e-n-f / sfcta-subway.json
Created October 19, 2016 18:15
San Francisco subway survey
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@e-n-f
e-n-f / index.html
Created January 26, 2014 00:44
Generic HTML for viewing arbitrary tiled web maps
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
@e-n-f
e-n-f / index.html
Created January 26, 2014 00:04
Display map tiles from tiles/{z}/{x}/{y}.png relative to the current directory
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
@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
@e-n-f
e-n-f / index.html
Last active December 21, 2015 15:09
TIGER HTML
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet' >
<![endif]-->
<style>