Skip to content

Instantly share code, notes, and snippets.

View philipashlock's full-sized avatar

Philip Ashlock philipashlock

View GitHub Profile
@philipashlock
philipashlock / performance-gov-themes.txt
Last active August 29, 2015 14:17
Performance.gov Themes
Administration of Justice
Agriculture
Commerce and Housing Credit
Community and Regional Development
Economic Security and Policy
Education, Training, Employment, and Social Services
Energy
General Government
General Science, Space, and Technology
Health
@philipashlock
philipashlock / national-data-book-taxonomy.txt
Created March 26, 2015 17:45
National Data Book Taxonomy
1. Population
2. Births, Deaths, Marriages, and Divorces
3. Health and Nutrition
4. Education
5. Law Enforcement, Courts, and Prisons
6. Geography and Environment
7. Elections
8. State and Local Government Finances and Employment
9. Federal Government Finances and Employment
10. National Security and Veterans Affairs
@philipashlock
philipashlock / pod-schema-v1.1-draft-example-minimal.json
Last active August 29, 2015 14:08
Project Open Data schema minimum example - v1.1 draft
{
"conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
"dataset": [
{
"accessLevel": "public",
"bureauCode": [
"018:10"
],
"contactPoint": {
"fn": "Jane Doe",
@philipashlock
philipashlock / pod-schema-v1.1-draft-example.json
Last active May 16, 2017 12:16
Project Open Data schema example - v1.1 draft
{
"@context": "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld",
"@id": "http://www.agency.gov/data.json",
"@type": "dcat:Catalog",
"conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
"describedBy": "https://project-open-data.cio.gov/v1.1/schema/catalog.json",
"dataset": [
{
"@type": "dcat:Dataset",
"accessLevel": "public",
@philipashlock
philipashlock / datagov-dataset.html
Last active August 29, 2015 14:05
Schema.org Dataset Markup
<article itemscope itemtype="http://schema.org/Dataset" class="module prose">
<header class="module-content page-header">
<ul class="nav nav-tabs">
<li class="active">
<a href="/dataset/real-estate-across-the-united-states-rexus-lease"> Dataset</a>
</li>
</ul>
</header>
@philipashlock
philipashlock / index.html
Created February 21, 2014 21:41
MIME regex test
<html lang="en">
<head>
<title>MIME regex</title>
</head>
<body>
<pre>
<script type="text/javascript">
@philipashlock
philipashlock / index.html
Last active March 15, 2021 10:39
ISO 8601 Date Validation
<html lang="en">
<head>
</head>
<body>
<pre>
<script type="text/javascript">
@philipashlock
philipashlock / index.html
Created January 30, 2014 20:57
Census Tiger Availability
Source: <a href="http://www.census.gov/geo/maps-data/data/tiger-line.html">http://www.census.gov/geo/maps-data/data/tiger-line.html</a>
<ul>
<li>Shapefiles are released in one of three types of coverages:
<ul>
<li>Nation-based </li>
<li>State-based </li>
<li>County-based</li>
</ul>
</li>
GEOID GOVERNMENT_NAME CITY STATE_ABBR
1517000 HONOLULU HONOLULU HI
0947515 MILFORD MILFORD CT
0602132 ANGELS CITY ANGELS CAMP CA
1304204 AUGUSTA-RICHMOND COUNTY AUGUSTA GA
2500765 AGAWAM AGAWAM MA
2525100 FRANKLIN FRANKLIN MA
2519330 EASTHAMPTON EASTHAMPTON MA
1362720 PRESTON PRESTON GA
2147512 LONE OAK PADUCAH KY
@philipashlock
philipashlock / openstates-api-examples.php
Created January 24, 2012 22:21
Functions to get both legislators and district boundaries from teh OpenStates API
<?php
$state_legislators = $this->state_legislators($data['latitude'], $data['longitude']);
$state_chambers = $this->process_legislators($state_legislators);
function state_legislators($lat, $long) {
$url = "http://openstates.org/api/v1/legislators/geo/?long=" . $long . "&lat=" . $lat . "&fields=state,chamber,district,full_name,url,photo_url&apikey=" . $this->config->item('sunlight_api_key');