Skip to content

Instantly share code, notes, and snippets.

@timwis
timwis / table.md
Last active December 2, 2016 11:51

Target table format

| ward | registered_total | registered_democratic | registered_republican | turnout_total | turnout_democratic | turnout_republican | turnout_pct_total | turnout_pct_democratic | turnout_pct_republican | |------|------|------|------|------|------|------|------|------|------|------|------|------|------|------| | 1 | | 66A |

Alternate

| ward | party | registered_total | registered_party | turnout_total | turnout_party | turnout_pct_total | turnout_pct_party |

@timwis
timwis / steps.md
Last active November 28, 2016 22:26
Comparing FY16 adopted budget scripts

First, fetch the published file and prepare it for comparison

# Fetch file
curl 'https://data.phila.gov/resource/6quj-54t7.csv?$limit=5000' | \

# Fix currency formatting
sed -E 's/,\$([0-9]+)\.00/,\1/g' | \

# Sort
@timwis
timwis / datasets.txt
Last active November 22, 2016 20:30
OpenDataPhilly datasets ordered by date metadata created
"Vacant Property Indicators: 2016-11-14T17:46:54.215540"
"Greenworks Dashboard: 2016-11-10T05:47:25.073084"
"Licenses and Inspections Trade Licenses: 2016-09-22T21:15:57.272811"
"Licenses and Inspections Business Licenses: 2016-09-22T21:14:38.869844"
"Licenses and Inspections Clean and Seal: 2016-09-22T18:07:28.682465"
"Licenses and Inspections: Inspections Data: 2016-09-22T16:17:08.376879"
"Licenses and Inspections Commercial Activity Licenses: 2016-09-22T15:36:26.156628"
"Licenses and Inspections Service Requests: 2016-09-22T14:31:12.542396"
"Licenses and Inspections Appeals of Code Violations and Permit Refusals: 2016-09-22T14:01:30.276425"
"DVRPC Freight Rail: 2016-08-16T13:52:59.204610"
@timwis
timwis / index.js
Created November 15, 2016 12:31
Test case demonstrating onload breaks with nested views
const choo = require('choo')
const html = require('choo/html')
const app = choo()
app.model({
state: {},
reducers: {
receive: (data, state) => ({})
},
@timwis
timwis / index.js
Created November 7, 2016 11:32
requirebin sketch
const style = require('typestyle').style
const html = require('bel')
const className = style({
height: '125px',
position: 'relative',
backgroundColor: '#d4d4d4',
'&:after': {
content: '"+"',
fontSize: '550%',
@timwis
timwis / map.js
Created November 5, 2016 23:20
leaflet in choo using isSameNode
const html = require('choo/html')
const L = require('leaflet')
module.exports = () => {
let cachedEl
let cachedCoords
let map
return function (coords) {
let currentCoords = coords
@timwis
timwis / README.md
Last active November 4, 2016 18:21
subscribeme

subscribeme

Monitors an API for new data and sends digest emails to subscribers.

Schema

queries

id query
3 status=active
@timwis
timwis / index.js
Created October 23, 2016 21:19
requirebin sketch
const choo = require('choo')
const html = require('choo/html')
const widget = require('cache-element/widget')
const L = require('leaflet')
const esri = require('esri-leaflet')
const basemap = 'https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityBasemap/MapServer'
const app = choo()
@timwis
timwis / index.js
Created October 11, 2016 11:56
requirebin sketch
const html = require('bel')
const el1 = html`
<div class="checkbox required-toggle">
<label><input type="checkbox"> Required</label>
</div>
`
const el2 = html`
<div class="checkbox required-toggle">
@timwis
timwis / index.js
Last active October 11, 2016 11:56
requirebin sketch
const html = require('bel')
const el1 = html`
<div class="checkbox required-toggle">
<label><input type="checkbox"> Required</label>
</div>
`
const el2 = html`
<div class="checkbox required-toggle">