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
// 1. Setup project on Heroku (SEE OTHER SHEET) | |
// 2. Setup app | |
////////////////////////////////////////////////// | |
//// RANDOM BLINK TIMER | |
//// NODE | |
// You will need to install the express module | |
// http://expressjs.com |
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
////////////////////////////////////////////////// | |
//// package.json | |
{ | |
"name": "servi-hello-world", | |
"version": "0.0.1", | |
"engines": { | |
"node": "0.8.x", | |
"npm": "2.x" | |
}, |
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
////////////////////////////////////////////////////////// | |
//// basic | |
var cheerio = require('cheerio'); | |
var request = require('request'); | |
var url = 'http://itp.nyu.edu/sigs/program/?sortby=tier&semesteryear=Spring%202015'; | |
request(url, function(err, resp, body) { | |
if (err) console.log(err); |
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
//////////////////////////////////////////////////////////////////// | |
//// BROWSER ACTION / POPUP | |
{ | |
"manifest_version": 2, | |
"name": "One-click Weather", | |
"description": "This extension demonstrates a 'browser action' with weather.", | |
"version": "1.0", |
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
function setup() { | |
createCanvas(600, 400); | |
noLoop(); | |
noStroke(); | |
textSize(20); | |
loadJSON("data.json", drawData); | |
} | |
function draw() { |
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 analyzing = false; | |
var recognition = new webkitSpeechRecognition(); | |
recognition.onresult = function(event) { | |
console.log(event) | |
var text = event.results[0][0].transcript; | |
if (analyzing == true) { |
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
// node-twilio docs: http://twilio.github.io/twilio-node/ | |
// TwiML xml response format docs: https://www.twilio.com/docs/api/twiml | |
// npm install twilio | |
var twilio = require('twilio'); | |
// npm install express | |
// setup express app | |
var express = require('express'); | |
var app = express(); |
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
//////////////////////////////////////////////////////////////////// | |
//// clmtrackr | |
<html> | |
<head> | |
<script src="clmtrackr.js"></script> | |
<script src="models/model_pca_20_svm.js"></script> | |
<script src="p5.js"></script> | |
<script src="p5.dom.js"></script> | |
<script> |
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
//////////////////////////////////////////////////////////////////// | |
//// LIVE VIDEO | |
// Now we need the video library | |
import processing.video.*; | |
// Capture object | |
Capture img; | |
// New images from camera |
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 params = { | |
url: encodeURI('http://p5js.org/'), | |
apikey: 'YOUR_KEY', | |
outputMode: 'json' | |
} | |
// Get sentiment of web page. | |
var url = 'http://access.alchemyapi.com/calls/url/URLGetTextSentiment'; | |
$.getJSON(url, params, function(data) { |