This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Leaflet, Mapbox and D3JS test</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.js'></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.css' rel='stylesheet' /> | |
<style> |
This file contains 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
## inspired by Mike Migurski's blog post on using twitter's public streaming API | |
## http://mike.teczno.com/notes/streaming-data-from-twitter.html | |
import json | |
from csv import writer | |
# create an empty list to store our tweets in | |
tweets = [] | |
# append each line of the data to our tweets list using the json module |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Our First Webpage</title> | |
</head> | |
<body> | |
<h1>Hello Internet!</h1> | |
</body> | |
</html> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Leaflet, Mapbox and D3JS test</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.js'></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script> | |
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.css' rel='stylesheet' /> |
This file contains 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
/*** Creative Computing Week 03 Class Code ***/ | |
// this is a comment for a single line of code. | |
/* this is a comment | |
that spans multiple | |
lines ... | |
*/ | |
// PRO TIP: a good practice to follow when you are first learning to code is to write what your code is doing in plain english above each line. |
This file contains 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
-- get the length in feet using NY Long Island State Plane Feet (EPSG:2263) | |
SELECT *, st_length(st_transform(the_geom, 2263)) as length FROM osm_nyc_ways_bicycle_just_nyc | |
-- we need to select the_geom_webmercator for data to render in cartodb's map view | |
SELECT cartodb_id, st_Centroid(the_geom_webmercator) as the_geom_webmercator FROM osm_nyc_ways_bicycle_just_nyc | |
-- fid out where the datasets intersect | |
SELECT a.the_geom_webmercator | |
FROM osm_nyc_ways_bicycle_just_nyc a, | |
cscl_bikeroute b |
This file contains 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
<!DOCTYPE html><html><head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Bushwick Community Map Intro</title> | |
<meta name="description" content="An introduction to the Bushwick Community Map"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="http://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/themes/css/cartodb.css"> | |
<link rel="stylesheet" href="http://cartodb.github.io/odyssey.js/sandbox/css/slides.css"> |
This file contains 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
<!DOCTYPE html><html><head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Bushwick Community Map Intro</title> | |
<meta name="description" content="An introduction to the Bushwick Community Map"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="http://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/themes/css/cartodb.css"> | |
<link rel="stylesheet" href="http://cartodb.github.io/odyssey.js/sandbox/css/slides.css"> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>NWB map intro test</title> | |
<meta name="description" content="An introduction to the Bushwick Community Map"> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
<link rel="stylesheet" href="http://cartodb.github.io/odyssey.js/sandbox/css/slides.css"> |
This file contains 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
var bbl = require('make_bbls').bbl; | |
var _ = require('underscore'); | |
var async = require('async'); | |
var pg = require('pg'); | |
pg.defaults.database = 'nyc_hpd'; | |
pg.defaults.host = 'localhost'; | |
pg.defaults.user = 'chrislhenrick'; | |
pg.defaults.password = ''; | |
pg.defaults.port = 5432; |