Skip to content

Instantly share code, notes, and snippets.

[
{
"name": "Old KCI Control Tower",
"alternative name": "Old MCI Control Tower",
"ebn": "275682",
"building type": "airport tower",
"building status": "demolished [destroyed]",
"architectural style": "modernism",
"zip": "64153",
"complex": "Kansas City International Airport",
@vlandham
vlandham / json_out.rb
Created September 24, 2013 21:57
ruby out to json
output_filename = 'out.json'
data = []
File.open(output_filename, 'w') do |file|
file.puts JSON.pretty_generate(JSON.parse(data.to_json))
end
@vlandham
vlandham / gist:6945600
Created October 12, 2013 03:50
clipping path notes
Here is the final product:
http://www.mappinghealth.com/flu#sim
The code is complex because I am doing other things such as "zooming
out" while the circle is growing. But here is the clip definition. one
thing that I found counter-intuitive is that the clipping shape is
actually a window that allows the background to show through, rather
than a shape that obstructs others.
from shapely.geometry import mapping, shape
from fiona import collection
import re
shapefile = "seattle.imposm-shapefiles/seattle.osm-roads.shp"
def street_direction(street):
dr = ''
if street:
Map {
background-color: #C6DEEE;
}
@road_size: 1;
#countries {
::outline {
// line-color: #85c5d3;
// line-width: 2;
import urllib2
import re
from BeautifulSoup import *
from datetime import *
symbols = ['YHOO', 'MU', 'AA', 'CI', 'EOG', 'ZMH', 'G', 'HON', 'IWM', 'WYE', 'JCP', 'OXY', 'AAPL', 'SBUX', 'MO', 'KLAC', 'SIRI', 'GDT', 'WMT', 'LLTC', 'PALM', 'EA', 'SUN', 'CL', 'JAVA', 'SMH', 'NBR', 'JNJ', 'GCI', 'SHLD', 'AMD', 'ORCL', 'ERIC', 'LEH', 'WLP', 'CAH', 'LXK', 'CAR', 'CVX', 'GE', 'DE', 'NTAP', 'BSC', 'VRSN', 'DNA', 'GENZ', 'ASKJ', 'BRCM', 'TGT', 'MCD', 'CMCS', 'KBH', 'SYMC', 'BAC', 'NCC', 'BSX', 'IR', 'UNH', 'F', 'ADBE', 'MDY', 'CCL', 'TASR', 'SCHW', 'GS', 'T', 'ADI', 'MON', 'HOG', 'DIA', 'SEPR', 'BTU', 'X', 'D', 'GILD', 'NEM', 'BUD', 'MET', 'CMX', 'AVP', 'MDT', 'QCOM', 'XLNX', 'XOM', 'AMGN', 'OSTK', 'AXP', 'AET', 'GLW', 'KMG', 'GM', 'MXIM', 'APOL', 'SGP', 'IBM', 'MS', 'SNDK', 'BA', 'KO', 'MER', 'RTH', 'M', 'FDC', 'PD', 'XLE', 'XLF', 'FLEX', 'KRB', 'UTX', 'TZOO', 'FDX', 'NKE', 'NXTL', 'DOW', 'HES', 'KSS', 'BP', 'BIIB', 'BBBY', 'SII', 'DELL', 'AIG', 'HIG', 'BBY', 'EBAY', 'RD', 'GPS', 'MERQE', 'PEP', 'IGT', 'CECO', 'ALL', '
#!/usr/bin/env ruby
require 'json'
require 'open-uri'
BASE_URL = "http://shop.nordstrom.com/FashionSearch.axd"
SEARCH = "color=metallic"
output_filename = "metals.json"
@vlandham
vlandham / setwd_hostname.R
Created November 18, 2013 21:09
attempt to hack the setwd based on hostname in R
if(system("hostname", intern=TRUE) == "y0319t598") {
setwd()
} else {
setwd()
}
diff --git a/coffee/vis.coffee b/coffee/vis.coffee
index e55dd2d..d125fe0 100644
--- a/coffee/vis.coffee
+++ b/coffee/vis.coffee
@@ -7,7 +7,9 @@ Bubbles = () ->
width = 980
height = 510
data = []
+ nodeG = null
node = null
diff --git a/coffee/vis.coffee b/coffee/vis.coffee
index d125fe0..6330c16 100644
--- a/coffee/vis.coffee
+++ b/coffee/vis.coffee
@@ -14,6 +14,8 @@ Bubbles = () ->
margin = {top: 5, right: 0, bottom: 0, left: 0}
# largest size for our bubbles
maxRadius = 65
+ clickWait = 200
+ nodeClickInProgress = false