Skip to content

Instantly share code, notes, and snippets.

View marks's full-sized avatar

Mark Silverberg marks

View GitHub Profile
@marks
marks / kick_off_runs.sh
Last active August 24, 2016 13:37
Quick bash script with CSV file to queue up multiple Domino runs. Run this with `sh kick_off_runs.sh runs_to_do.csv`
#!/bin/bash
IFS=","
while read file args
do
echo "++ Kicking off Domino run with 'domino run $file $args' ++"
domino run --no-sync $file $args
done < $1
from domino import Domino
import pandas as pd
import json
import os
# connect to domino; be sure to have DOMINO_USER_API_KEY env set. Domino automatically includes this for you
domino = Domino("nick/digits", api_key=os.environ['DOMINO_USER_API_KEY'], host="https://app.dominodatalab.com")
raw_runs = domino.runs_list()['data']
print raw_runs
var callWithJQuery;
callWithJQuery = function(pivotModule) {
if (typeof exports === "object" && typeof module === "object") {
return pivotModule(require("jquery"), require("c3"));
} else if (typeof define === "function" && define.amd) {
return define(["jquery", "c3"], pivotModule);
} else {
return pivotModule(jQuery, c3);
}
(function() {
var callWithJQuery;
callWithJQuery = function(pivotModule) {
if (typeof exports === "object" && typeof module === "object") {
return pivotModule(require("jquery"), require("c3"));
} else if (typeof define === "function" && define.amd) {
return define(["jquery", "c3"], pivotModule);
} else {
return pivotModule(jQuery, c3);
@marks
marks / query.url
Last active May 13, 2016 20:22
Query for the 5 features (rows) closest to 47.59815,-122.334540 in https://data.seattle.gov/d/82su-5fxf
https://data.seattle.gov/resource/3c4b-gdxv.json?$select=*,DISTANCE_IN_METERS(location, 'POINT(-122.334540 47.59815)') AS distance_in_meters&$limit=5&$order=distance_in_meters asc
{
"version": "2",
"header": {
"title": "Sample of Combined NNDSS Table II Data (2016)",
"description": "<strong style='font-size:16px;'><a href='https://data.cdc.gov/'>Data from multiple data.cdc.gov datasets</a> </strong> | This page by mark.silverberg@socrata.com <br><br>In these tables, all conditions with a 5-year average annual national total of more than or equals 1,000 cases but less than or equals 10,000 cases will be displayed (≥ 1,000 and ≤ 10,000). The Table includes total number of cases reported in the United States, by region and by states, in accordance with the current method of displaying MMWR data. Data on United States exclude counts from US territories.",
"navigation": [
{
"url": "https://cdc-science.demo.socrata.com/dataset/Sample-of-Combined-NNDSS-datasets/nmaj-nshg",
"label": "Full dataset"
},
@marks
marks / Nominees.markdown
Last active March 12, 2016 21:09
Nominees
@marks
marks / BaltimoreTravelOptions.ipynb
Last active February 28, 2016 18:32
Thomas/Darron/Mark Celebrating Cities Hack The Last Mile work
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marks
marks / SPSS_code.py
Created February 25, 2016 21:07
SPSS and Stata code for importing a Socrata open dataset using SODA CSV APIs
# Requires official IBM SPSS extension to be installed [https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/We70df3195ec8_4f95_9773_42e448fa9029/page/Downloads%20for%20IBM%C2%AE%20SPSS%C2%AE%20Statistics]
* Encoding: UTF-8.
BEGIN PROGRAM Python.
# Import python dependencies
import urllib2
import csv
@marks
marks / scraping-because-there-is-no-API-or-export.ipynb
Last active February 12, 2016 17:41
Web scraping solution of CDC Vessel Sanitation Program Inspections -- DDOD issue #11 (https://github.com/demand-driven-open-data/ddod-intake/issues/11)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.