Skip to content

Instantly share code, notes, and snippets.

Avatar

Zev Ross zross

View GitHub Profile
View junk.R
result<-createCensusTable(
seqnum=c(
"B17010" # Population
),
state="ny",
yr=2010,
span=5,
thetype="e",
sumlevel="BLOCKGROUP",
lineNumbers=list(
@zross
zross / index.html
Last active Aug 29, 2015
rCharts D3 Spatial Packages
View index.html
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://nvd3.org/assets/css/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='http://nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script>
@zross
zross / index.html
Last active Aug 29, 2015
Leaflet Map Created With R Package leafletR
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Leafletmap</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js?2"></script>
<style type="text/css">
body {
@zross
zross / index.html
Last active Aug 29, 2015
Put topojson on LeafletJS map
View index.html
<html>
<head>
<title>HTML5</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=650, user-scalable=yes">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
@zross
zross / esri-leaflet.js
Last active Aug 29, 2015
Adding ArcGIS services to LeafletJS
View esri-leaflet.js
/*! Esri-Leaflet - v0.0.1-beta.4 - 2014-03-09
* Copyright (c) 2014 Environmental Systems Research Institute, Inc.
* Apache License*/
L.esri={_callback:{}},L.esri.Support={CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest)},L.esri.RequestHandlers={CORS:function(a,b,c,d){var e=new XMLHttpRequest;b.f="json",e.onreadystatechange=function(){var a;if(4===e.readyState){try{a=JSON.parse(e.responseText)}catch(b){a={error:"Could not parse response as JSON."}}d?c.call(d,a):c(a)}},e.open("GET",a+"?"+L.esri.Util.serialize(b),!0),e.send(null)},JSONP:function(a,b,c,d){var e="c"+(1e9*Math.random()).toString(36).replace(".","_");b.f="json",b.callback="L.esri._callback."+e;var f=L.DomUtil.create("script",null,document.body);f.type="text/javascript",f.src=a+"?"+L.esri.Util.serialize(b),f.id=e,L.esri._callback[e]=function(a){d?c.call(d,a):c(a),document.body.removeChild(f),delete L.esri._callback[e]}}},L.esri.get=L.esri.Support.CORS?L.esri.RequestHandlers.CORS:L.esri.RequestHandlers.JSONP,L.esri.Mixins={},
@zross
zross / index.html
Created Jun 18, 2014
cartodb infowindow trouble
View index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="">
<head>
<style>
#map1{
height: 400px;
width: 400px;
View exp_sidewalkcafes.js
var exp_sidewalkcafes = {
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id_qgis2leaf": 0, "color_qgis2leaf": '#4b8217', "radius_qgis2leaf": 2.5, "transp_qgis2leaf": 1.0, "transp_fill_qgis2leaf": 1.0, "CafeType": "All Cafes", "Shape_Leng": 1246.829238 }, "geometry": { "type": "LineString", "coordinates": [ [ -73.995864681742205, 40.70931879343253 ], [ -73.995719955343887, 40.709341590415235 ], [ -73.994206733869348, 40.709579942150661 ], [ -73.994259568461672, 40.709977648269344 ], [ -73.995971438079593, 40.70971603950121 ], [ -73.995880255834521, 40.709376748462233 ], [ -73.995864681742205, 40.70931879343253 ] ] } },
{ "type": "Feature", "properties": { "id_qgis2leaf": 1, "color_qgis2leaf": '#4b8217', "radius_qgis2leaf": 2.5, "transp_qgis2leaf": 1.0, "transp_fill_qgis2leaf": 1.0, "CafeType": "All Cafes", "Shape
@zross
zross / index.html
Created Sep 29, 2014
Path on Leaflet Map with odd zoom behavior
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' />
@zross
zross / index.html
Created Oct 15, 2014
Leaflet Boilerplate (MapBox tiles, Bootstrap, jQuery)
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0" />
<title>Leaflet Boilerplate</title>
@zross
zross / businesses.json
Last active Aug 29, 2015
Leaflet.js Tips, Step 5 (specialized icons)
View businesses.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.