Skip to content

Instantly share code, notes, and snippets.

@d3netxer
d3netxer / D3 date-time series chart
Last active April 13, 2021 11:47
D3 date-time series chart
title
file with a leading space = GIST title
http://stackoverflow.com/questions/19896900/how-to-change-the-name-of-a-gist-in-github
@d3netxer
d3netxer / MapGive 2014 Daily Changesets
Last active August 29, 2015 14:14
MapGive 2014 Daily Changesets
title
@d3netxer
d3netxer / MapGive 2014 Daily Users
Created January 27, 2015 14:20
MapGive 2014 Daily Users
title
@d3netxer
d3netxer / MapGive 2014 Cumulative Changesets
Created January 27, 2015 14:24
MapGive 2014 Cumulative Changesets
title
@d3netxer
d3netxer / embedded gist
Last active August 29, 2015 14:14
embedded gist
title
@d3netxer
d3netxer / embedded gist 2
Created January 27, 2015 21:15
embedded gist 2
title
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //
@d3netxer
d3netxer / test_form.html
Created February 14, 2015 12:19
test_form.html
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
{% load staticfiles %}
<html>
<head>
<style>
#map_canvas {
width: 500px;
height: 400px;
@d3netxer
d3netxer / piura_omk
Last active January 30, 2022 06:28
overpass-turbo query to get all buildings, highways, and major points of interest from bounding box
(
// get all buildings
way[building]({{bbox}});
// get all roads
way[highway]({{bbox}});
// get important POIs
node[leisure]({{bbox}});
node[sport]({{bbox}});
node[man_made]({{bbox}});
node[historic]({{bbox}});
@d3netxer
d3netxer / piura_extent
Created January 6, 2016 19:33
This is the bounding box used for extracting the OSM basemap used in Piura, Peru
left lower right upper
-80.707 -5.259 -80.559 -5.136