Skip to content

Instantly share code, notes, and snippets.

View zross's full-sized avatar

Zev Ross zross

View GitHub Profile
@zross
zross / index.html
Last active January 21, 2016 10:09
HTML: CSV processing, two options (D3 and jquery-csv).
<!DOCTYPE html>
<html>
<head>
<title>HTML5</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=650, user-scalable=yes">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@zross
zross / index.html
Created September 25, 2013 19:11
HTML: CartoDB with Google and custom InfoWindow
<!DOCTYPE html>
<html>
<!-- A note: if you're not seeing the elements in the custom
infowindow look at the cartodb dashboard and make sure they're
turned on
-->
<head>
<title>HTML5</title>
@zross
zross / index.html
Last active December 23, 2015 22:49
HTML: CartoDB with Google and (more) custom window (incl. SVG)
<!DOCTYPE html>
<html>
<!-- ZevRoss Spatial Analysis, www.zevross.com -->
<!-- A note: if you're not seeing the elements in the custom
infowindow look at the cartodb dashboard and make sure they're
turned on
-->
@zross
zross / index.html
Last active December 24, 2015 00:29
HTML: CartoDB with Google, Highcharts custom infowindow
<!DOCTYPE html>
<html>
<!-- ZevRoss Spatial Analysis, www.zevross.com -->
<!-- A note: if you're not seeing the elements in the custom
infowindow look at the cartodb dashboard and make sure they're
turned on
-->
@zross
zross / index.html
Last active March 8, 2016 17:00
HTML: CartoDB with Google Highcharts custom infowindow (detail)
<!DOCTYPE html>
<html>
<!-- ZevRoss Spatial Analysis, www.zevross.com -->
<!-- A note: if you're not seeing the elements in the custom
infowindow look at the cartodb dashboard and make sure they're
turned on
-->
@zross
zross / index.html
Last active December 24, 2015 02:19
HTML CartoDB, Google, Fade Map, Style Google
<!DOCTYPE html>
<!--
ZevRoss Spatial Analysis, www.zevross.com
Some code and fade image from http://cartodb.github.io/cartodb.js/examples/TheHobbitLocations/
To create faded image, create two layers in Photoshop, add
layer mask to top layer and put a gradient as mask.
-->
@zross
zross / banner.css
Last active December 24, 2015 16:09
CSS: Simple banner page with side by side map
body {
background: #FFFFEB;
color: #333;
/*font-family: "PT serif", serif;*/
font-family: 'PT Sans', sans-serif;
position: relative;
width: 100%;
margin-top: 0;
margin-right: auto;
margin-bottom: 4em;
@zross
zross / index.html
Created October 4, 2013 13:23
HTML: Two Google Maps side by side and linked (CSS banner)
<!DOCTYPE html>
<html>
<head>
<title>HTML5</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=650, user-scalable=yes">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@zross
zross / index.html
Last active December 24, 2015 16:19
HTLM: Two Google maps side by side, linked with legend
<!DOCTYPE html>
<html>
<head>
<title>HTML5</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=650, user-scalable=yes">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
CREATE TYPE pluto_reverse_geocode_result AS (address text, ownername text,distance float);
CREATE OR REPLACE FUNCTION pluto_reverse_geocode(float,float,int) RETURNS SETOF pluto_reverse_geocode_result
AS '
WITH subq as (SELECT address,the_geom,ownername
FROM nyc_mappluto_13v1
ORDER BY the_geom <-> CDB_LatLng($1,$2) LIMIT 20)
SELECT address,ownername,
ST_Distance(the_geom::geography, CDB_LatLng($1,$2)::geography) as distance
FROM subq
WHERE ST_Distance(the_geom::geography, CDB_LatLng($1,$2)::geography) < $3