Skip to content

Instantly share code, notes, and snippets.

View hampelm's full-sized avatar

Matt Hampel hampelm

View GitHub Profile
with prices as (
select new.name, new.units, old_price, new_price, new_price::float - old_price::float as price_diff, (old_price %2B new_price)/2.0 as price_avg
from (
select name, units, price as old_price
from coop where date = current_date - '7 days'::interval
) old
join (
select name, units, price as new_price
from coop where date = (select max(date) from coop)
) new
@hampelm
hampelm / quote.md
Last active September 10, 2016 15:35

Copied from https://apapadop.wordpress.com/2013/07/14/secrets-a-memoir-of-vietnam-and-the-pentagon-papers-by-daniel-ellsberg/

p.237: Ellsberg’s advice to Henry Kissinger on the psychological and behavioural effects of secret clearances on people:

“Henry, there’s something I would like to tell you, for what it’s worth, something I wish I had been told years ago. You’ve been a consultant for a long time, and you’ve dealt a great deal with top secret information. But you’re about to receive a whole slew of special clearances, maybe fifteen or twenty of them, that are higher than top secret.

“I’ve had a number of these myself, and I’ve known other people who have just acquired them, and I have a pretty good sense of what the effects of receiving these clearances are on a person who didn’t previously know they even existed. And the effects of reading the information that they will make available to you.

“First, you’ll be exhilarated by some of this new information, and by having it all – so much! incredible!

# Create a new branch
# gb my-new-branch
alias gb='git branch'
# Create a new branch and switch to it
# gw a-different-new-branch
alias gw='git checkout -b'
# Commit changes
# gc "Fixed null-concat bug in renderer"
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 863964
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 864995
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 865306
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 865657
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 866033
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 866085
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 867896
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 868647
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 868691
Jun 25 06:00:48 ddot-updates app/web.1: AVL Trip ID: 869006
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find burt rd & lyndon in GTFS. AVL ID: 712
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find burt road & outer drive in GTFS. AVL ID: 713
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find burt rd & pierson court north in GTFS. AVL ID: 714
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find burt rd & pierson in GTFS. AVL ID: 715
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find burt rd & plymouth in GTFS. AVL ID: 716
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find burt rd & schoolcraft in GTFS. AVL ID: 717
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find burt rd & schoolcraft in GTFS. AVL ID: 718
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find band stand & dosins museum in GTFS. AVL ID: 719
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find cobo hall & by pass in GTFS. AVL ID: 721
Jun 25 05:55:06 ddot-updates app/web.1: Error: did not find capitol park 07 i
ein yyyymm name form available url
270472137 201412 AUTISM ALLIANCE OF MICHIGAN 990 true https://s3.amazonaws.com/irs-form-990/201513089349300306_public.xml
454949783 201412 WAYNE CHILDRENS HEALTHCARE ACCESS PROGRAM INC 990 false
381211227 201412 CHARLES STEWART MOTT FOUNDATION 990PF false
270858135 201509 LOVE N KINDNESS COMMUNITY DEVELOPMENT CORPORATION 990 false
133600232 201412 CORPORATION FOR SUPPORTIVE HOUSING 990 true https://s3.amazonaws.com/irs-form-990/201532809349300223_public.xml
383335060 201412 MICHIGAN YOUTH APPRECIATION FOUNDATION 990 true https://s3.amazonaws.com/irs-form-990/201512819349300101_public.xml
320171869 201509 METRO DETROIT CENTER FOR INDEPENDENT LIVING INC 990 false
383124115 201512 100 BLACK MEN OF GREATER DETROIT INC 990EZ false
381784340 201412 MAX M AND MARJORIE S FISHER FOUNDATION INC 990PF false
var vt = new mapnik.VectorTile(z, x, y);
// Get data in the tile
var stream = collection.find({ ... within query ...}).stream();
stream.on('data', function(data) {
vt.addGeoJSON(JSON.stringify(data.feature), 'my-layer');
});
stream.on('end', function() {
{
"ZONE_TYPE": {
"name": "zone-type",
"answers": {}
},
"ZONE_DISTR": {
"name": "zone-distr",
"answers": {}
},
# Create a new branch
# gb my-new-branch
alias gb='git branch'
# Create a new branch and switch to it
# gw a-different-new-branch
alias gw='git checkout -b'
# Commit changes
# gc "Fixed null-concat bug in renderer"
{
"cmd": [
"/usr/local/bin/node",
"${packages}/JSLint/linter.js",
// Examples using predef flag
"--predef", "['Ember', 'angular', 'document', '\\$', '_', 'JQuery', 'FB', 'window']",
// tolerate missing 'use strict' pragma
"--sloppy",
// suggest an indent level of two spaces