Skip to content

Instantly share code, notes, and snippets.

View caged's full-sized avatar
🎸

Justin Palmer caged

🎸
View GitHub Profile
@caged
caged / index.html
Created August 8, 2013 18:55
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;
@caged
caged / index.html
Last active January 16, 2020 10:24
Plot vector points on a cropped raster image with d3.js
<!doctype html>
<meta charset="utf-8">
<body>
<style media="screen">
body {
margin: 0;
}
.supermarket {
fill: red;
@caged
caged / keybase.md
Created January 11, 2019 03:40
keybase.md

Keybase proof

I hereby claim:

  • I am caged on github.
  • I am caged (https://keybase.io/caged) on keybase.
  • I have a public key ASBSVYNed5hAUR9evtZAZiOmAKi0Mg40LlXoSEWlX2e0hAo

To claim this, I am signing this object:

class A extends Component {
handleSomeEvent = (value: string) => {
/* do stuff */
}
render() {
return <B onSubmit={this.handleSomeEvent} />
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@caged
caged / d3-multi-line.js.coffee
Created December 30, 2011 17:23
d3.js line chart with multiple lines and points
$ ->
version = Number(document.location.hash.replace('#', ''))
data = [[3,7,9,1,4,6,8,2,5], [5,2,3,4,9,6,4,6,8]]
[pt, pl, pr, pb] = [20, 20, 20, 20] # padding
w = 800 - (pl + pr)
h = 300 - (pt + pb)
max = d3.max(data, (d) -> d3.max(d))
# Scales
x = d3.scale.linear().domain([0, data[0].length - 1]).range [0, w]
@caged
caged / machine-learning-deploy.md
Created June 1, 2017 02:19
Resources for deploying machine learning models to production systems.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test simple</title>
<script type="text/javascript">
'use strict';
var top = 1;
</script>
</head>
@caged
caged / gist:1173725
Created August 26, 2011 15:50
d3.js experiment - Donuts, Bars and Crime.
#
# CoffeeScript for http://dealloc.me/demos/crime/2011.html
# Copyright (c) 2011 Justin Palmer <http://github.com/Caged>
# LICENSE: http://www.opensource.org/licenses/mit-license.php
$ ->
hash = document.location.hash
year = if hash then hash.replace('#', '') else 2011
[pt,pl,pb,pr] = [35, 20, 20, 20]
w = (900 - (pl + pr)) / 2
h = w
ndjson-join 'true' <(cat oregon.json) <(shp2json -n data/shp/arc_reference/ned_1arcsec_g.shp) \
| ndjson-filter -r jsts 'function(d) { var r = new jsts.io.GeoJSONReader(), g1 = r.read(d[0].geometry), g2 = r.read(d[1].geometry); return !g1.intersection(g2).isEmpty() }.call(this, d)' \
| ndjson-map 'd[1]'