Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd (He/Him) mheadd

View GitHub Profile
mheadd / lobby-data.sql
Last active August 29, 2015 13:57
SQL script to import lobbying registration data into MySQL instance.
-- Create database.
-- Create table.
USE lobbydata;
DROP TABLE IF EXISTS registrations;
CREATE TABLE registrations (
`RegistrationNumber` VARCHAR(12) NOT NULL,
`RegistrationName` VARCHAR(100) NOT NULL,
mheadd /
Created April 22, 2014 19:20
Get the top 100 NYC bike share riders from July, 2013.
curl -s "*%20from%20%229dd48bd2-fa77-43bb-a433-1227b3a17623%22%20ORDER%20BY%20tripduration%20DESC%20LIMIT%20100" \
| sed 's/birth year/birth_year/g;s/start station name/start_station_name/g;s/end station name/end_station_name/g' \
| jq .result.records[] \
| jq '[.tripduration, .birth_year, .gender, .start_station_name, .end_station_name]' \
| jq @csv \
| sed 's/\\//g;s/""/"/g'
mheadd /
Last active August 29, 2015 14:01
Some URLs that can be used to query NYPD Vehicle Crash Data on

Accidents with the greatest number of persons injured in Manhattan (top 10 in descending order).*%20from%20%22036fcc27-5b0a-401c-aca5-3de5b90143dc%22%20ORDER%20BY%20%22PersonsInjured%22%20DESC%20LIMIT%2010

Total number of accidents in Queens where a cyclist was injured.*)%20from%20%227d6dd1e8-0f86-48c9-80c4-fd0c88a58b3b%22%20WHERE%20%22CyclistsInjured%22%20%3E%200

Total number of pedestrians killed in accidents in Brooklyn.

mheadd /
Last active August 29, 2015 14:01
Summer of Open Source: Intro to Git/GitHub Links
"page": {
"hasmore": true,
"limit": 25,
"offset": 0
"status": 200,
"result": [
"value": "14CAP-00000-00082",
mheadd /
Last active August 29, 2015 14:05
Some great recent articles / blog posts on civic technology

The Three Levers of Civic Engagement

by Anthea Watson Strong

Over time, I have come to believe that our inability to attract mass usage for our products is, in part, due to a willful ignorance of how users are motivated to civic action. To build the technologies that will transform government and governance, we need to do a better job of designing and building tools for real world users.

Read more.

Let’s build the road network of civic tech.

by Eric Hysen

...let’s stop focusing on the next killer app, but instead on building healthy ecosystems.

mheadd / civic-id-example.html
Last active August 29, 2015 14:05
An example showing the Civic ID process using jQuery.
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../assets/ico/favicon.ico">
mheadd /
Created August 29, 2014 18:48
jq recipe to fetch Healthy Corner Store Locations in Philadelphia
echo 'x_coord,y_coord,name' > my-file.csv
curl -s "" \
| jq .features[] \
| jq '[.geometry.x, .geometry.y, .attributes.OFFICIAL_S]' \
| jq @csv \
| sed 's/\\//g;s/""/"/g' \
>> my-file.csv
mheadd /
Last active August 29, 2015 14:06
mheadd / rivercast.php
Created September 11, 2014 17:25
A phone application to get the current Rivercast status on the Schuylkill River
$rivercast = json_decode(file_get_contents(""));
say("The current river cast on the Skew kill river is, " . $rivercast[0]->status . ".");
say("Happy recreating!");