Skip to content

Instantly share code, notes, and snippets.

View stuartlynn's full-sized avatar

Stuart Lynn stuartlynn

  • Two Sigma
  • Brooklyn
View GitHub Profile
@stuartlynn
stuartlynn / index.html
Created May 10, 2016 17:49
Working segmentation namer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
@stuartlynn
stuartlynn / index.html
Created May 10, 2016 16:27
segment naming app with search
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
@stuartlynn
stuartlynn / index.html
Last active May 10, 2016 16:26
Segment naming app
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
@stuartlynn
stuartlynn / index.html
Last active May 10, 2016 15:25
Segment naming app
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
@stuartlynn
stuartlynn / index.md
Created May 9, 2016 20:08
Segmentation blog post

The US census is an amazing achievement, every 5 years it chronicles and records a number of facets of people and life in the US.

As humans though, when asked about what a neighborhood is like we don't rhyme off a series of census variables for that neighborhood. Instead, weather it be the hipsters of Willamsberg of the stroller families of Park Slope we tend to describe neighborhoods in terms of archetypes that we can all relate to. Often then its illustrative to have these kinds of labels for the census areas.

How might we go about achieving this? Well, each one of us is a precious individual

@stuartlynn
stuartlynn / query.sql
Last active May 3, 2016 15:44
Chicago Schools safe passage crimes aggregation
select school_nam, schoolid, stuartlynn.cps_safe_passage_routes_buffered_100m.the_geom, date_part('hour', stuartlynn.crimes_2001_to_present_100_meters_from_safe_passage.date),
sum( CASE WHEN primary_type='PROSTITUTION' THEN 1 ELSE 0 END) as prostitution_count,
sum( CASE WHEN primary_type='OTHER OFFENSE' THEN 1 ELSE 0 END) as other_count,
sum( CASE WHEN primary_type='THEFT' THEN 1 ELSE 0 END) as theft_count,
sum( CASE WHEN primary_type='LIQUOR LAW VIOLATION' THEN 1 ELSE 0 END) as liquor_law_violation_count,
sum( CASE WHEN primary_type='NON-CRIMINAL' THEN 1 ELSE 0 END) as non_criminal_count,
@stuartlynn
stuartlynn / categories_10.json
Last active May 2, 2016 21:51
Category 10 descriptions
"extra":{
"categories":{
"Hispanic and Kids":{
"Education":{
"Less than highschool": "High",
"High School": "Average",
"Some College / Assc degree" :"Low",
"Bachelor Degree" :"Low",
"Grad Degree" :"Low"
},
@stuartlynn
stuartlynn / chicago_gardens.csv
Created April 29, 2016 14:30
Chicago Graden data
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 18 columns, instead of 12 in line 3.
Address,Animals,Communities,Growing_site_types,comunity_garden_type,food_producing,gardenId,growing_site_dormant,growing_site_name,growing_size_fenced,growing_size_locked,latitude,longitude,municipalities,structures_features,support_organization,ward,water
"2917 W Armitage Ave, Chicago, IL 60647, USA",Bees (hives),LOGAN SQUARE,"Community Garden,Ornamental / Beautification",Collective,1,18,0,Armitage Richmond Garden,1,0,41.9173078,-87.6999892,Chicago,"Compost System,Grill / Cooking Station,Fire Pit,Seating Area,Shed / Storage box,Electricity Outlet",Urban Habitat Chicago,35,"Rain collection system ( rain barrels, cisterns),Hose connected to private property"
6040 N Kilpatrick,,FOREST GLEN,"School Garden,Ornamental / Beautification,Habitat / Conservation / Prairie",,0,839,0,Sauganash Elementary School,,,41.9912865,-87.7463637,Chicago,,,39,
"11710 S. Morgan Street Chicago, IL 60643",,WEST PULLMAN,"Food Donation,School Garden,Ornamental / Beautification",,1,685,0,Higgins Elementary Community Academy,0,0,41.680959
@stuartlynn
stuartlynn / index.html
Last active April 29, 2016 05:50
gardens_example
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Deep-Insights.js – Madrid: Airbnb, nightlife, and public transport</title>
<meta name=viewport content="width=device-width initial-scale=1">
<link href="http://cartodb.com/favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" />
<link rel="stylesheet" href="http://libs.cartocdn.com/di.js/v0/themes/css/deep-insights.css" />
@stuartlynn
stuartlynn / deep_insights_template.html
Last active April 29, 2016 04:41
DoGoodData - Working example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Deep-Insights.js – Madrid: Airbnb, nightlife, and public transport</title>
<meta name=viewport content="width=device-width initial-scale=1">
<link href="http://cartodb.com/favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="../dist/themes/css/deep-insights.css" />
<script src="../dist/deep-insights.uncompressed.js"></script>
<style type="text/css">