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 layerSource = { | |
type: "torque", | |
options: { | |
auth_token: '{yourAuthToken}', | |
user_name: "{yourCartoDBUsername}", | |
tile_style:"{torqueCartoCSS}", | |
named_map: { | |
name: "{namedmap}" | |
} | |
} |
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
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 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 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 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 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 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 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 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
select geom from nybb WHERE borocode < 5 | |
UNION ALL SELECT ST_Translate(geom,.05,.2,4326) as geom FROM nybb WHERE borocode=5 |
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
Sub Auto_Open() | |
Dim oToolbar As CommandBar | |
Dim oButton As CommandBarButton | |
Dim MyToolbar As String | |
' Give the toolbar a name | |
MyToolbar = "Kewl Tools" | |
On Error Resume Next | |
' so that it doesn't stop on the next line if the toolbar's already there |