Skip to content

Instantly share code, notes, and snippets.

Avatar

Enrico Spinielli espinielli

View GitHub Profile
@espinielli
espinielli / drops.json
Created May 31, 2012
Mapping the first day of the Blitz bombs with d3.js and Google Maps
View drops.json
[{"damage": "Grocers: 3x2 roof damaged", "location": {"lat": 51.4927867208977, "lon": -0.0718224107752507, "display_name": "Southwark Park Road, St. George's Estate, Bermondsey, London Borough of Southwark, Greater London, London, England, SE16 3QN, United Kingdom"}, "type": "IB", "order": 1, "time": "0:08"}, {"damage": "Bakers: 3x2 roof damaged", "location": {"lat": 51.4927867208977, "lon": -0.0718224107752507, "display_name": "Southwark Park Road, St. George's Estate, Bermondsey, London Borough of Southwark, Greater London, London, England, SE16 3QN, United Kingdom"}, "type": "IB", "order": 2, "time": "0:10"}, {"damage": "front room on 1st floor and contents slightly damaged. 3x2 rood damage", "location": {"lat": 51.4927867208977, "lon": -0.0718224107752507, "display_name": "Southwark Park Road, St. George's Estate, Bermondsey, London Borough of Southwark, Greater London, London, England, SE16 3QN, United Kingdom"}, "type": "IB", "order": 3, "time": "0:15"}, {"damage": "10x6 roof damage", "location": {"lat"
@espinielli
espinielli / drops.json
Created Jun 2, 2012
The first day of the Blitz animated (somehow)
View drops.json
[{"damage": "Grocers: 3x2 roof damaged", "location": {"lat": 51.4927867208977, "lon": -0.0718224107752507, "display_name": "Southwark Park Road, St. George's Estate, Bermondsey, London Borough of Southwark, Greater London, London, England, SE16 3QN, United Kingdom"}, "type": "IB", "order": 1, "time": "0:08"}, {"damage": "Bakers: 3x2 roof damaged", "location": {"lat": 51.4927867208977, "lon": -0.0718224107752507, "display_name": "Southwark Park Road, St. George's Estate, Bermondsey, London Borough of Southwark, Greater London, London, England, SE16 3QN, United Kingdom"}, "type": "IB", "order": 2, "time": "0:10"}, {"damage": "front room on 1st floor and contents slightly damaged. 3x2 rood damage", "location": {"lat": 51.4927867208977, "lon": -0.0718224107752507, "display_name": "Southwark Park Road, St. George's Estate, Bermondsey, London Borough of Southwark, Greater London, London, England, SE16 3QN, United Kingdom"}, "type": "IB", "order": 3, "time": "0:15"}, {"damage": "10x6 roof damage", "location": {"lat"
@espinielli
espinielli / CKOG-plus.pl
Last active Dec 19, 2017
Cahill-Keyes coordinate transformations
View CKOG-plus.pl
#! /usr/bin/perl -w
# December 2010
use Math::Trig;
# Calculate values that should be global, to minimize repeated calculations
($sin60, $cos60, $yTranslate, @Prelims) = Preliminary();
print "($sin60, $cos60, $yTranslate, @Prelims)";
$Skip = "";
unless ($Skip) {
@espinielli
espinielli / MegamapMaker-prep9.pl
Created Dec 12, 2012
Megamap creation file from Mary Jo Graça: Chill-Keyes map projection
View MegamapMaker-prep9.pl
#! /usr/bin/perl -w
# 2012-03-15 This is program "MegamapMaker-prep9" by Mary Jo Graça
# BLOCK (1) : read file of longitude,latitude coordinates and convert to x,y coordinates
$Skip[1] = "YES";
# BLOCK (2): prepare graticule file of 15°, with joined Antarctica, for Duncan
$Skip[2] = "YES";
# BLOCK (3): prepare graticule file of 5°, with joined Antarctica, for Duncan
$Skip[3] = "YES";
# BLOCK (4): Prepare octant boundaries, with joined Antarctica, for Duncan
@espinielli
espinielli / index.html
Last active Dec 11, 2015 — forked from mbostock/.block
Polar clock
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#clock {
position: relative;
background: #222;
width: 960px;
height: 800px;
}
@espinielli
espinielli / README.md
Last active Dec 12, 2015 — forked from mbostock/.block
Solar Terminator on Butterfly Map Projection
View README.md

Forked from Mike Bostock's Solar Terminator gist. Changed map projection to Waterman's Butterfly.

It would be nice to:

  • fade transition from day to night
  • use satellite image as background (one for day area, the other with lights for the night area)
  • plot the position of the Sun [done] and the Moon, like here or here
  • use astronomical symbols for Sun [done] and Moon (there are SVG versions...)
@espinielli
espinielli / Makefile
Last active Feb 4, 2017 — forked from mbostock/.block
Random World Tour with flags
View Makefile
#
# NOTE: flags_names has been _manually_ edited to match Wikipedia commons' names
# with respect to country flags file names
#
all: world-country-flags
.PHONY : flags_ids
flags_ids:
generate_flags_ids.sh > flags_ids
@espinielli
espinielli / README.md
Last active Apr 12, 2019
Flattened icosahedron world map.
View README.md
@espinielli
espinielli / README.md
Last active Aug 16, 2019 — forked from mbostock/.block
Cahill-Keyes map projection
View README.md

Cahill-Keyes map projection (I modified Waterman butterfly projection in the geo.polyhedron D3 plugin to have incisions at 17° (Thanks Jason for the great inspiration!).

Gene Keyes's first 5 principles:

  • principal format to an M-shape, joined at south Atlantic
  • principal dividing meridian to 20° W
  • incisions at equator and poles at 17°
  • proportionality of geocells
  • circular parallels for the polar regions
View README.md

The NASA Blue Marble is reprojected using d3.geo.kavrayskiy7’s invert function.