Workshop: http://bit.ly/cdb-int-workshop
The source of our data is NYC's Open Data: https://data.cityofnewyork.us/Social-Services/Rat-Sightings/3q43-55fe
# sh ./animations.sh | |
# set keyboard repeat rate to 0, so instant | |
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms) | |
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms) | |
# instant quick look animation | |
defaults write -g QLPanelAnimationDuration -float 0 | |
# increase speed of animation when resizing window of Cocoa apps |
// you will also have to setup the referring domains on your marvel developer portal | |
var PRIV_KEY = "this-should-be-a-long-hash"; | |
var PUBLIC_KEY = "so-should-this"; | |
function getMarvelResponse() { | |
// you need a new ts every request | |
var ts = new Date().getTime(); | |
var hash = CryptoJS.MD5(ts + PRIV_KEY + PUBLIC_KEY).toString(); |
The source of our data is NYC's Open Data: https://data.cityofnewyork.us/Social-Services/Rat-Sightings/3q43-55fe
var child_process = require('child_process'), | |
http = require('http'); | |
url = require('url'), | |
ffmpeg = null; | |
var livestream = function (req, resp) { | |
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible). | |
var input = 'udp://225.1.1.1:8208'; |
/** | |
* Locations.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/#!documentation/models | |
*/ | |
module.exports = { | |
seedData:[ |
var degrees2meters = function(lon,lat) { | |
var x = lon * 20037508.34 / 180; | |
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); | |
y = y * 20037508.34 / 180; | |
return [x, y] | |
} | |
//test | |
lon= -77.035974 | |
lat = 38.898717 |
var stringify = function(obj, prop) { | |
var placeholder = '____PLACEHOLDER____'; | |
var fns = []; | |
var json = JSON.stringify(obj, function(key, value) { | |
if (typeof value === 'function') { | |
fns.push(value); | |
return placeholder; | |
} | |
return value; | |
}, 2); |