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
| <!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"> | |
| <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
| <title>Bootstrap 101 Template</title> | |
| <!-- Bootstrap --> |
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
| --Replace county FIPS code with NYC boro code, concatenate with 6-digit tract ID | |
| SELECT | |
| *, | |
| ( | |
| ( | |
| CASE WHEN (substring(geo_id2,4,2) = '61') | |
| THEN '1' | |
| WHEN (substring(geo_id2,4,2) = '05') | |
| THEN '2' |
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
| <!DOCTYPE html> | |
| <html class="html"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> | |
| <style> | |
| .axis text { | |
| font: 10px sans-serif; |
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
| { | |
| "version": "2", | |
| "header": { | |
| "title": "NYC 311 Data", | |
| "description": "The last 3 million NYC 311 complaints", | |
| "navigation": [ | |
| { | |
| "label": "Download", | |
| "url": "" | |
| } |
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
| { | |
| "version": "2", | |
| "header": { | |
| "title": "NYC 311 Data", | |
| "description": "The last 3 million NYC 311 complaints", | |
| "navigation": [ | |
| { | |
| "label": "Download", | |
| "url": "" | |
| } |
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
| NYC DOT Live Speed Sensors data: | |
| http://207.251.86.229/nyc-links-cams/LinkSpeedQuery.txt | |
| h/t https://twitter.com/5h15h/status/684116277586100224 |
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
| Socrata datasets often include a column of type 'Location', which may include a WGS84 latitude and longitude in parenthesis, separated by a comma. `(latitude,longitude)` This format does not lend itself well to mapping the point data, as most mapping software is expecting separate attribute columns for latitude and longitude. The SQL below is meant for use in a PostGIS database such as CartoDB. It parses the latitude and longitude from the a Socrata location column, and creates a point geometry in `the_geom` using PostGIS' `ST_geomfromtext()` function. | |
| With this function you can liberate point location data from Socrata's unconventional format, and put it to use in maps! | |
| UPDATE tablename | |
| SET the_geom = | |
| ST_setsrid( | |
| ST_geomfromtext( | |
| concat( | |
| 'POINT(', |
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
| var layerSource = { | |
| type: "torque", | |
| options: { | |
| auth_token: '{yourAuthToken}', | |
| user_name: "{yourCartoDBUsername}", | |
| tile_style:"{torqueCartoCSS}", | |
| named_map: { | |
| name: "{namedmap}" | |
| } | |
| } |
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
| alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --url "http://localhost/~chriswhong/$(basename $PWD)"' |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" /> | |
| <style> | |
| #map, html, body { | |
| height:100%; | |
| width:100%; |