Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View espinielli's full-sized avatar

Enrico Spinielli espinielli

View GitHub Profile
@espinielli
espinielli / drops.json
Created May 31, 2012 14:34
Mapping the first day of the Blitz bombs with d3.js and Google Maps
[{"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 June 2, 2012 10:12
The first day of the Blitz animated (somehow)
[{"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 December 19, 2017 19:10
Cahill-Keyes coordinate transformations
#! /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 December 12, 2012 17:06
Megamap creation file from Mary Jo Graça: Chill-Keyes map projection
#! /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 December 11, 2015 01:38 — forked from mbostock/.block
Polar clock
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#clock {
position: relative;
background: #222;
width: 960px;
height: 800px;
}
@espinielli
espinielli / README.md
Last active December 12, 2015 01:28 — forked from mbostock/.block
Solar Terminator on Butterfly Map Projection

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 February 4, 2017 20:56 — forked from mbostock/.block
Random World Tour with flags
#
# 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 May 10, 2022 12:50
Flattened icosahedron world map.
@espinielli
espinielli / README.md
Last active December 13, 2021 23:56 — forked from mbostock/.block
Cahill-Keyes map projection

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

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