Skip to content

Instantly share code, notes, and snippets.

View hugolpz's full-sized avatar
🎯
Focusing

Lopez Hugo hugolpz

🎯
Focusing
View GitHub Profile
@mbostock
mbostock / .block
Last active February 9, 2016 02:02
OPHZ Zooming
license: gpl-3.0
@hugolpz
hugolpz / Makefile
Last active December 19, 2015 10:19 — forked from eidmanna/Makefile
France_location_map.svg (Wikipedia)
fra.json: countries.json subunits.json places.json
topojson --id-property none -p name=name -p name=NAME -o fra0813b.json -- countries.json subunits.json places.json
### FILES FILTERS & 2JSON
countries.json: ne_10m_admin_0_sovereignty.shp
ogr2ogr -f GeoJSON -where "admin IN ('Spain', 'Italy', 'Andorra', 'Switzerland', 'Belgium', 'Netherlands', 'Luxembourg', 'Germany', 'United Kingdom')" countries.json ne_10m_admin_0_sovereignty.shp
subunits.json: ne_10m_admin_1_states_provinces_shp
ogr2ogr -f GeoJSON -where "admin IN ('France')" subunits.json ne_10m_admin_1_states_provinces_shp.shp
places.json: ne_10m_populated_places.shp
ogr2ogr -f GeoJSON -where "ADM0NAME = 'France' OR SOV0NAME = 'French Republic' OR ISO_A2 = 'FR' AND FEATURECLA = 'Admin-1 region capital'" places.json ne_10m_populated_places.shp
@kristopherjohnson
kristopherjohnson / cheatsheet.js
Last active March 1, 2022 19:46
Random Javascript snippets/examples
// Get a reference to the global object (`window` in the browser, `global` on the server).
var root = (function () {
return this || (0 || eval)('this');
}());
var elemWithId = document.getElementById('anId');
elemWithId.innerHTML = markup;
var elemsWithName = document.getElementsByName('aName');
var firstElem = elems[0];
@biovisualize
biovisualize / index.html
Created June 9, 2011 14:42
Simple D3 tooltip
<!DOCTYPE html>
<html >
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
</head>
<body>
<div class="example_div"></div>
<script type="text/javascript">
var tooltip = d3.select("body")
.append("div")