Skip to content

Instantly share code, notes, and snippets.

View marks's full-sized avatar

Mark Silverberg marks

View GitHub Profile
@marks
marks / states.geojson
Created January 20, 2016 20:13 — forked from mapsam/states.geojson
US States GeoJSON from NaturalEarthData
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marks
marks / 0_reuse_code.js
Created January 20, 2016 18:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@marks
marks / chicago-crimes.v2.json
Last active January 17, 2016 20:39 — forked from timwis/chicago-crimes.v2.json
Chicago crime incidents VizWit configuration
{
"version": "2",
"header": {
"title": "Crime Incidents in Chicago",
"description": "This dataset reflects reported incidents of crime (with the exception of murders where data exists for each victim) that occurred in the City of Chicago from 2001 to present, minus the most recent seven days. Data is extracted from the Chicago Police Department's CLEAR (Citizen Law Enforcement Analysis and Reporting) system. In order to protect the privacy of crime victims, addresses are shown at the block level only and specific locations are not identified.",
"navigation": [{
"label": "Download",
"url": "https://data.cityofchicago.org/api/views/ijzp-q8t2/rows.csv?accessType=DOWNLOAD&bom=true"
}]
},
@marks
marks / README.md
Last active November 28, 2015 16:06
portals

README is empty

@marks
marks / README.md
Last active August 29, 2015 14:25 — forked from jefffriesen/README.md
US Zip Codes
@marks
marks / gist:b74e56bc9eb48772b77d
Last active August 29, 2015 14:21
Example SAS code bringing in data from a Socrata Open Data Portal (open.whitehouse.gov in this case). Output can be seen at http://imgur.com/m6ozopR
filename datain url
'http://open.whitehouse.gov/resource/i9g8-9web.csv?$limit=50000';
proc import datafile=datain out=whsalaries dbms=csv replace;
getnames=yes;
/* proc print data=whsalaries; */
proc means;
@marks
marks / README.md
Last active August 29, 2015 14:20
Algorithmia algorithm for descriptive statistics on numeric columns of data
$ ckanapi dump datasets -r http://data.noaa.gov --all -O json.json
Traceback (most recent call last):
File "/usr/local/bin/ckanapi", line 9, in <module>
load_entry_point('ckanapi==3.3', 'console_scripts', 'ckanapi')()
File "/Library/Python/2.7/site-packages/ckanapi/cli/main.py", line 95, in main
return dump_things(ckan, thing[0], arguments)
File "/Library/Python/2.7/site-packages/ckanapi/cli/dump.py", line 33, in dump_things
return dump_things_worker(ckan, thing, arguments)
File "/Library/Python/2.7/site-packages/ckanapi/cli/dump.py", line 135, in dump_things_worker
'include_datasets': False})
(function(){
var uStatePaths=[
{id:"HI",n:"Hawaii",d:"M233.08751,519.30948L235.02744,515.75293L237.2907,515.42961L237.61402,516.23791L235.51242,519.30948L233.08751,519.30948ZM243.27217,515.59127L249.4153,518.17784L251.51689,517.85452L253.1335,513.97465L252.48686,510.57977L248.28366,510.09479L244.24213,511.87306L243.27217,515.59127ZM273.9878,525.61427L277.706,531.11074L280.13092,530.78742L281.26255,530.30244L282.7175,531.59573L286.43571,531.43407L287.40568,529.97912L284.49577,528.20085L282.55584,524.48263L280.45424,520.92609L274.63444,523.83599L273.9878,525.61427ZM294.19545,534.50564L295.48874,532.5657L300.17691,533.53566L300.82356,533.05068L306.96668,533.69732L306.64336,534.99062L304.05678,536.44556L299.69193,536.12224L294.19545,534.50564ZM299.53027,539.67879L301.47021,543.55866L304.54176,542.42703L304.86509,540.81041L303.24848,538.70882L299.53027,538.3855L299.53027,539.67879ZM306.4817,538.54716L308.74496,535.63726L313.43313,538.06218L317.79798,539.19381L322.16284,541.94205L322.16284,543.88198L318.6063,545.6
var codes_to_category = {}
codes_to_category['100'] = "Fire, Other"
codes_to_category['110'] = "Structure fire, Other (conversion only)"
codes_to_category['111'] = "Building fire"
codes_to_category['112'] = "Fires in structure other than in a building"
codes_to_category['113'] = "Cooking fire, confined to container"
codes_to_category['114'] = "Chimney or flue fire, confined to chimney or flue"
codes_to_category['115'] = "Incinerator overload or malfunction, fire confined"
codes_to_category['116'] = "Fuel burner/boiler malfunction, fire confined"
codes_to_category['117'] = "Commercial Compactor fire, confined to rubbish"