Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
@BenWard
BenWard / tumblr_export.js
Created March 25, 2013 06:49
Quick and dirty script to pull down all of your posts from Tumblr as raw, unformatted JSON responses. Useful for crude back-ups, or if you're going to transform them later and only want to hit the API once. There's no rate limiting or back-off or anything, and the blog I wrote it for only had 580 posts, so I'm not sure what issues you might run …
!function () {
// You'll need an application registered at http://www.tumblr.com/oauth/apps
// Just put the OAuth Consumer Key here (Tumblr's version of application-auth
// is really simple and unsigned.)
const key = "";
// Next, put your Tumblr domain name here. That might be 'benw.tumblr.com' or
// 'blog.benward.me'.
const domain = "example.tumblr.com";
// Since we're pasting this on gist rather than giving you a full repo to
@tomstove
tomstove / index.html
Created April 24, 2013 11:32
Europe from night
<!DOCTYPE html>
<head>
<style>
body {
background: #040C1F;
}
.urbanareas {
fill: silver;
@tomstove
tomstove / index.html
Created May 13, 2013 10:56
London with D3
<!DOCTYPE html>
<head>
<style>
.landuse {
fill: #efefef;
}
.roads {
fill: none;
@mbostock
mbostock / .block
Last active March 27, 2024 22:16
Vector Tiles
license: gpl-3.0
redirect: https://observablehq.com/@d3/vector-tiles
@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

@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,
# 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
@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];
@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
@mbostock
mbostock / .block
Last active February 9, 2016 02:02 — forked from mbostock/.block
Dynamic Simplification II
license: gpl-3.0