Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
Zoom Tile size at equator (km) Resolution at equator (m)
0 22568 88155
1 11284 44078
2 7656 29904
3 4577 17881
4 2443 9544
5 1244 4861
6 625 2442
7 313 1223
@mbostock
mbostock / .block
Last active November 20, 2016 23:20
Dynamic Simplification IV
license: gpl-3.0
@officeofjane
officeofjane / README.md
Last active December 17, 2017 18:04
Small multiple bar charts with tooltips
@brunosan
brunosan / index.md
Last active June 15, 2018 23:57
This is a list inspired by some of our current or potential lines of work at the World Bank Innovation Labs. The “Innovations in Big Data Analytics” program helps to strengthen the World Bank capabilities to effectively use big data in its operational and strategic work.

This is a list inspired by some of our current or potential lines of work at the World Bank Innovation Labs. The “Innovations in Big Data Analytics” program helps to strengthen the World Bank capabilities to effectively use big data in its operational and strategic work.

We are always looking for great Data Scientists. If you can solve any of these [using open software], you'll be heads down helping us from day one. Email us to brunosanchez@worldbank.org

(This list is updated frequently).

1. Nightlights from Satellite

We are building an open stack to process nightly data from satellite and query light output from all known villages. Currently we are doing 20 years of nightly data for 600,000 villages in India.

@wboykinm
wboykinm / hexgrid.sql
Created February 12, 2014 17:12
Hexgrid code
WITH hgrid AS
(SELECT CDB_HexagonGrid(ST_Expand(CDB_XYZ_Extent(/* INSERT TILE XYZ SOMEHOW */), CDB_XYZ_Resolution(/* CURRENT ZOOM */) * 15), CDB_XYZ_Resolution(/* CURRENT ZOOM */) * 15) AS cell)
SELECT hgrid.cell AS the_geom_webmercator,
count(i.cartodb_id) AS points_count,
count(i.cartodb_id)/power(15 * CDB_XYZ_Resolution(/* CURRENT ZOOM */), 2) AS points_density,
1 AS cartodb_id
FROM hgrid,
(SELECT *
FROM /* TABLE NAME HERE */) i
WHERE ST_Intersects(i.the_geom_webmercator, hgrid.cell)
@jacobandresen
jacobandresen / gist:836127
Created February 20, 2011 17:28
nonimatim openlayers jquery example
$(function() {
var geoCodeURL = "http://nominatim.openstreetmap.org/search";
var map = new OpenLayers.Map({ div: "map" });
var osm = new OpenLayers.Layer.OSM();
map.addLayers([osm]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(
new OpenLayers.LonLat( 9.2134, 55.3028).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
#! /bin/bash -ex
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * Dan Stahlke's https://github.com/gina-alaska/dans-gdal-scripts
# * convert (image-magick)
#
# Reference info:
@robertsdionne
robertsdionne / deepdream-install.md
Last active February 15, 2021 16:07
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
<html>
<head>
<title>Deckgl RGB PointCloud + Mapbox</title>
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js"></script>
<link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css">
<style>
body {
background-color: #000000;
margin: 0;
@tmcw
tmcw / ajax_for_cats.md
Last active April 19, 2021 21:08
AJAX for Cats

AJAX For Cats

I will assume that you are familiar with Javascript and HTML - read up on jsforcats.com if you need Javascript chops, and Learn HTML for HTML.

AJAX is a feature of Javascript and your browser that downloads new data after you initially request a page: so you live-update content and pull in new bits of content a user requests. AJAX is how the Pinterest home page keeps loading content when you scroll, and it's how Gmail can ring in new emails without requiring you to click 'refresh' all the time.

Let's clear things up. Like Javascript for Cats, it's best to use Google Chrome for this, and to use your web developer extensions.

Requests