This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route("/1.0/data/geographies") | |
@qwarg_validate({ | |
'geo_ids': {'valid': StringList(), 'required': True}, | |
}) | |
@crossdomain(origin='*') | |
def get_geo_polys(): | |
geo_ids = [] | |
for geoid_str in request.qwargs.geo_ids: | |
geoid_split = geoid_str.split('|') | |
if len(geoid_split) == 2 and len(geoid_split[0]) == 3: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hit the /parents API endpoint | |
$.getJSON(parentGeoAPI) | |
.done(function(results) { | |
var parents = results['parents']; | |
// list of unique parent sumlev types, maintaining order | |
var parentRelations = _.uniq(_.pluck(parents, 'sumlevel')); | |
// collect parents into individual sumlev groups | |
var parentGroups = _.groupBy(parents, function(d) { | |
return d.sumlevel; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"geography": { | |
"census_release": "ACS 2012 1-year", | |
"parents": { | |
"county": { | |
"total_population": 475735, | |
"short_name": "Spokane County", | |
"land_area": 4568197852, | |
"sumlevel": "050", | |
"full_name": "Spokane County, WA", | |
"full_geoid": "05000US53063" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RowID | Distillery | Body | Sweetness | Smoky | Medicinal | Tobacco | Honey | Spicy | Winey | Nutty | Malty | Fruity | Floral | Postcode | Latitude | Longitude | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01 | Aberfeldy | 2 | 2 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 2 | 2 | 2 | PH15 2EB | 286580 | 749680 | |
02 | Aberlour | 3 | 3 | 1 | 0 | 0 | 4 | 3 | 2 | 2 | 3 | 3 | 2 | AB38 9PJ | 326340 | 842570 | |
03 | AnCnoc | 1 | 3 | 2 | 0 | 0 | 2 | 0 | 0 | 2 | 2 | 3 | 2 | AB5 5LI | 352960 | 839320 | |
04 | Ardbeg | 4 | 1 | 4 | 4 | 0 | 0 | 2 | 0 | 1 | 2 | 1 | 0 | PA42 7EB | 141560 | 646220 | |
05 | Ardmore | 2 | 2 | 2 | 0 | 0 | 1 | 1 | 1 | 2 | 3 | 1 | 1 | AB54 4NH | 355350 | 829140 | |
06 | ArranIsleOf | 2 | 3 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 2 | KA27 8HJ | 194050 | 649950 | |
07 | Auchentoshan | 0 | 2 | 0 | 0 | 0 | 1 | 1 | 0 | 2 | 2 | 3 | 3 | G81 4SJ | 247670 | 672610 | |
08 | Auchroisk | 2 | 3 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 2 | 2 | 1 | AB55 3XS | 340754 | 848623 | |
09 | Aultmore | 2 | 2 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | AB55 3QY | 340754 | 848623 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import tweepy | |
import os | |
import json | |
consumer_key = '' | |
consumer_secret = '' | |
access_key = '' | |
access_secret = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3.selection.prototype.moveToFront = function() { | |
return this.each(function() { | |
this.parentNode.appendChild(this); | |
}); | |
}; | |
Then you can say: | |
d3.select("p").moveToFront().style("color", "red"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash_prompt | |
# Example: | |
# nicolas@host: ~/.dotfiles on master[+!?$] | |
# $ | |
# Screenshot: http://i.imgur.com/DSJ1G.png | |
# iTerm2 prefs: import Solarized theme (disable bright colors for bold text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Ask for the administrator password upfront | |
sudo -v | |
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
############################################################################### | |
# General UI/UX # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Diner will lure the thin stuff.. mean, but it's not, the door after work of average. really only lacked a bit far as Rockwood cement its glory you certainly won't find ten faceless places, but not sure was close to be back, the only assume some flavor to give the place a better. found No Li's take the dish on the spot, but it was more so much better the most disgusting cup of the Back to expect what it would I mean, the overpowering sweetness was sweet.. chicken wrap, it did give it just caught them well known for half of the al pastor didn't., though not to yet another Elk, maybe we would suggest it a surprise was homemade or Veraci or Veraci or Veraci or not to do we can be left with the baked goods felt fresh tuna tasted like it was, I mean, if you're looking for many things are still were nicely seasoned. everyone to be OK. stuff. way of Canada since Northern Lights changed? An improvement is under new to say" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"geography": { | |
"total_population": 209504, | |
"census_release": "ACS 2011 5-year", | |
"short_name": "Spokane", | |
"land_area": 178021482, | |
"sumlevel": "160", | |
"full_name": "Spokane, WA" | |
}, | |
"demographics": { |