Skip to content

Instantly share code, notes, and snippets.

View strefethen's full-sized avatar

Steve Trefethen strefethen

View GitHub Profile
@strefethen
strefethen / massdot.ts
Last active May 21, 2023 04:59
TypeScript code demonstrating authenticating to and calling a MassDOT API
// Usage:
// 1. Request API access here: https://www.mass.gov/service-details/highway-data-for-developers
// 2. When your account details arrive create 3 environment vars
// MASSDOT_USERNAME
// MASSDOT_PASSWORD
// MASSDOT_SECRET_KEY
// 3. ts-node massdot.ts
import dotenv from "dotenv";
@strefethen
strefethen / foo.py
Created June 19, 2017 20:56
My python example
import os
import filesystem
def ...
@strefethen
strefethen / python.py
Created June 16, 2017 18:46
Test Gist
import os
PropertySpec ps = new PropertySpec();
ps.setAll(true);
ps.setType("AuthorizationManager");
PropertyFilterSpec pfs = new PropertyFilterSpec();
pfs.getPropSet().add(ps);
ObjectSpec objSpec = new ObjectSpec();
objSpec.setObj(serviceContent.getAuthorizationManager());
pfs.getObjectSet().add(objSpec);
pfs.setReportMissingObjectsInResults(Boolean.TRUE);
RetrieveOptions retOp = new RetrieveOptions();
@strefethen
strefethen / localyticsexampledata.json
Last active May 28, 2016 06:48
Plotting Localytics Retention data using R and Shiny
{
"results": [
{
"birth_week": "2014-09-08",
"users": 1,
"week": "2014-12-29"
},
{
"birth_week": "2014-09-29",
"users": 1640,