Skip to content

Instantly share code, notes, and snippets.

@ekimed
ekimed / flatten.js
Created June 28, 2014 01:33
flatten
var result = [];
function flatten(array) {
for (var i = 0; i < array.length; i++) {
if (Array.isArray(array[i])) {
flatten(array[i]);
} else {
result.push(array[i]);
}
}
@ekimed
ekimed / _.md
Created April 24, 2014 13:16
all cities pie
@ekimed
ekimed / _.md
Created April 24, 2014 13:09
allCitiesPieChart
@ekimed
ekimed / _.md
Created April 24, 2014 13:08
allCitiesPieChart
@ekimed
ekimed / _.md
Created April 16, 2014 20:59
Tributary inlet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": ["-122.424612993055", "37.8014488257836"]}, "type": "Feature", "id": 0, "properties": {"date": "02/18/2003", "description": "FORGERY, CREDIT CARD", "title": "FRAUD"}}, {"geometry": {"type": "Point", "coordinates": ["-122.420120319211", "37.7877570602182"]}, "type": "Feature", "id": 1, "properties": {"date": "04/17/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.42025048261", "37.7800745746105"]}, "type": "Feature", "id": 2, "properties": {"date": "02/18/2003", "description": "GRAND THEFT PICKPOCKET", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.390718076188", "37.7385560584619"]}, "type": "Feature", "id": 3, "properties": {"date": "02/18/2003", "description": "SALE OF BASE/ROCK COCAINE", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.390718076188", "37.7385560584619"]}, "type": "Feature
@ekimed
ekimed / ex36LPTHW
Created September 16, 2013 00:53
Exercise 36 from LearnPythonTheHardWay
from sys import exit
def start():
print "Welcome to the game of...'Would you rather...?'"
print "You will have two choices to choose from."
print "Enter either 1 or 2 for your choices."
print "Do you wish to proceed? (Press Enter to continue CRTL-C to exit.)"
proceed = raw_input("> ")