Skip to content

Instantly share code, notes, and snippets.

Mark Headd mheadd

Block or report user

Report or block mheadd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mheadd on github.
  • I am mheadd ( on keybase.
  • I have a public key ASDf5v_IBXcBfsgDRP1fwqY16evvJMtC_SLI6H_bMN1VpAo

To claim this, I am signing this object:

mheadd /
Last active Jul 21, 2017
A simple script to pull down businesses by license type and display in a searchable HTML table.
# License number (e.g., 3381).
# The name of the file to populate with records.
echo "pri_contact_last_name, pri_contact_first_name, pri_contact_company_name, pri_contact_address1, pri_contact_city, pri_contact_state, pri_contact_zip, license_number, license_type_name, license_type_code" > $FILE_NAME
mheadd /
Last active Aug 23, 2016
Steps to import Philly311 data into an SQLite DB to enable SQL queries

Here are some steps to bring the bulk Philly311 CSV file into a local SQLite database to enable SQL queries.

Tools you'll use

  • sqlite3 (installed by default on OS X - try typing in ~$ which sqlite3 at a command prompt).
  • csvsql (follow installation instructions here if not already installed).
  • SQLite Manager for Firefox.


mheadd / philly-311-stats.csv
Last active Aug 23, 2016
Counts for service name and service code from Philly 311 data
View philly-311-stats.csv
Service Code Service Name # of Requests
SR-IR01 Information Request 674869
SR-LI21 Maintenance Residential or Commercial 40001
SR-ST03 Rubbish/Recyclable Material Collection 31159
Directory Assistance 25545
SR-ST02 Illegal Dumping 24401
SR-PD01 Abandoned Vehicle 22109
SR-ST01 Street Defect 22005
SR-CL01 Graffiti Removal 17160
SR-ST18 Salting 14282
mheadd /
Last active Aug 8, 2016
Calculating commuter routes with & without 81 N through Downtown Syracuse

From Town of Tully (Town Hall) to Syracuse Coworks

Standard Route

  • Start out going west on Meetinghouse Rd toward State Route 281/NY-281.
  • Turn right onto State Route 281/NY-281.
  • State Route 281/NY-281 becomes US Route 11/US-11 N.
  • Merge onto I-81 N via the ramp on the left.
  • Take the Adams St exit, EXIT 18, toward Harrison St.
  • Stay straight to go onto Almond St.
  • Turn left onto E Genesee St/NY-92.
mheadd / datausa_census_api.rmd
Created Jul 11, 2016 — forked from lecy/
Building Census Dataset in R Using API
View datausa_census_api.rmd
# Using the API for Census Data in R
This gist contains some notes on constructing a query for census and economic data from the []( site. This is a quick-start guide to their API; for in-depth documentation check out their [API documentation](
A great way to learn how to structure a query is to visit a specific page and click on the "Options" button on top of any graph, then select "API" to see the query syntax that created the graph.
## Example Use
mheadd /
Last active Jul 13, 2016
Unpermitted Upstate


Use state-level data on business registration, permitting and inspections to cross check against local data sets for non-permitted businesses.


  • Identify unlicensed or unpermitted businesses or business activity.
  • Identify business that are not in compliance with local zoning ordinances (e.g., areas that are not zoned for commercial activities).
  • Validate (or optimize) snow plowing routes, particularly during times of snow or weather related emergencies.
  • Generate macro-level indicators of business activity in a city or region.
mheadd /
Last active May 24, 2016
Street name auto complete services for City of Syracuse and Onondaga County
~$ curl -s '' \
-H 'Content-Type: application/json' \
--data-binary '{"street":"Geddes St"}' 
"Arden Dr & Geddes St S"
"Bear St W To Geddes St N"
"Bellevue Ave & Geddes St"
mysql> select distinct(Conviction_Description) from convictions where Conviction_Description like '%SPEED%';
| Conviction_Description                             |
| SPEED IN ZONE                                      |
| SPEEDING                                           |
| SPEEDING +15                                       |
You can’t perform that action at this time.