Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
@mbostock
mbostock / .block
Last active March 31, 2016 20:09
See-Through Globe
license: gpl-3.0
@tomgp
tomgp / LICENSE.txt
Last active May 29, 2019 21:20
Simple D3 clock
ISC License (ISC)
Copyright 2019 Tom Pearson
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@mbostock
mbostock / .block
Last active February 9, 2016 02:02 — forked from mbostock/.block
Map Zooming III
license: gpl-3.0
@mbostock
mbostock / .block
Last active February 9, 2016 02:02 — forked from mbostock/.block
Dynamic Simplification II
license: gpl-3.0
@robinhouston
robinhouston / index.html
Last active December 19, 2015 21:58
Maze flood fill
<!DOCTYPE html>
<title>Maze flood fill</title>
<style>
canvas { display: block; margin: auto; border: 1px solid #999; }
</style>
<canvas width="800" height="500"></canvas>
<script>
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
@robinhouston
robinhouston / index.html
Last active October 27, 2019 19:15
Dudeney’s hinged triangle-square
<!DOCTYPE html>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
div { width: 800px; height: 500px; margin: auto; }
svg { width: 100%; height: 100%; stroke-width: 0.01; stroke: white; fill: #4485B6; }
</style>
<div></div>
<script>
function point_to_string(point, origin) {
if (typeof origin == "undefined") origin = [0, 0];
# Quickie processing for LC81770782013190LGN00
# Cf. http://mapbox.com/blog/processing-landsat-8/
convert -combine *_B{4,3,2}.TIF rgb.tif
convert -resize 200% rgb.tif rgb-big.tif
convert -compose Colorize *_B8.TIF rgb-big.tif -composite pan.tif
convert -channel B -gamma 0.95 -channel RGB -sigmoidal-contrast 60x13% pan.tif ready.tif
convert -crop 3000x2000+8000+6000 ready.tif crater.jpeg
convert -crop 3000x2000+2000+6000 ready.tif cliff.jpeg
@bsudekum
bsudekum / index.html
Created July 2, 2013 18:12
Airports
<!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.1.0/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.1.0/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.ie.css' rel='stylesheet' >
<![endif]-->
<style>
@davewalk
davewalk / gist:5893611
Last active June 15, 2018 18:58
Using Stamen map tiles in Leaflet without loading the tile.stamen.js file
var tonerUrl = "http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png";
var url = tonerUrl.replace(/({[A-Z]})/g, function(s) {
return s.toLowerCase();
});
var basemap = L.tileLayer(url, {
subdomains: ['','a.','b.','c.','d.'],
minZoom: 0,
maxZoom: 20,
@turban
turban / README.md
Last active April 14, 2016 13:11
UTM zones with D3.js

As the name implies, the Universal Transverse Mercator (UTM) projection is based on the cylindrical Transverse Mercator projection.

The UTM system divides the Earth between 80°S and 84°N latitude into 60 zones, each 6° of longitude in width. The zones are numbered from 1 to 60 proceeding east from the anitmeridian (180°).

This rotating Transverse Mercator projection shows the 60 UTM zones around the Earth. The projection has constant scale along the changing central meridian, and regions near it are mapped with low distortion. Just like on the regular Mercator projection, areas further away from the central meridian are increasingly distorted.

UTM is often used to show regions or countries with a greater north-south extent, like mainland Norway, which is usually depicted in UTM 33.

More informatio