Skip to content

Instantly share code, notes, and snippets.

View nerik's full-sized avatar
🤩

Erik Escoffier nerik

🤩
View GitHub Profile
@nerik
nerik / index.js
Created December 7, 2016 16:04
Quick histograms in the browser console with d3
const bins = d3.histogram()(data);
const x = d3.scaleLinear().domain([0, d3.max(bins, d => d.length)]).range([0, 30]);
console.table(bins.filter(bin => bin.length).map(bin => {
const binMin = d3.min(bin).toLocaleString();
const binMax = d3.max(bin).toLocaleString();
return {
range: [binMin, binMax].join('-'),
bars: Array(Math.round(x(bin.length))).join('█'),
num: bin.length
};
@nerik
nerik / test.kml
Last active September 30, 2016 14:49
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<ScreenOverlay>
<Icon>
<href>https://s2.graphiq.com/sites/default/files/stories/t2/tiny_cat_12573_8950.jpg</href>
</Icon>
<overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<rotationXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
WITH iso_walk AS (
SELECT
name,
cdb_isochrone(
the_geom,
‘walk’,
Array[120,300,600,900,1200,1800]
) isochrone
FROM nerikcarto.sxsw_venues
@nerik
nerik / ..generator-test
Last active February 22, 2016 10:50
generator-test - Another awesome CartoDB viz !
Another awesome CartoDB viz !
@nerik
nerik / ..toggleMapView
Created February 17, 2016 09:07
toggleMapView - Another awesome CartoDB viz !
Another awesome CartoDB viz !
@nerik
nerik / ..sxsw
Last active March 11, 2016 10:18
sxsw - Plan your time at SXSW strategically
Plan your time at SXSW strategically
@nerik
nerik / ..grammys
Last active February 16, 2016 16:38
grammys - Visualizing Twitter activity during 2016 Grammy Awards
Visualizing Twitter activity during 2016 Grammy Awards
@nerik
nerik / ..my-viz
Created February 15, 2016 11:03
my-viz - Another awesome CartoDB viz !
Another awesome CartoDB viz !