Skip to content

Instantly share code, notes, and snippets.

View lmccart's full-sized avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
@lmccart
lmccart / gist:0d197f91806b42caf123
Last active February 11, 2018 17:47
Arduino Yun + node.js + p5.js
// 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
//////////////////////////////////////////////////
//// package.json
{
"name": "servi-hello-world",
"version": "0.0.1",
"engines": {
"node": "0.8.x",
"npm": "2.x"
},
@lmccart
lmccart / gist:5e4262594db7ed580e9e
Last active August 29, 2015 14:19
web scraping
//////////////////////////////////////////////////////////
//// 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);
@lmccart
lmccart / gist:33f75e740bc9482f8092
Last active May 6, 2023 00:26
browser extensions
////////////////////////////////////////////////////////////////////
//// BROWSER ACTION / POPUP
{
"manifest_version": 2,
"name": "One-click Weather",
"description": "This extension demonstrates a 'browser action' with weather.",
"version": "1.0",
function setup() {
createCanvas(600, 400);
noLoop();
noStroke();
textSize(20);
loadJSON("data.json", drawData);
}
function draw() {
@lmccart
lmccart / gist:0f8de1a9481c71cb3d87
Created March 26, 2015 17:51
speech api + alchemy
var analyzing = false;
var recognition = new webkitSpeechRecognition();
recognition.onresult = function(event) {
console.log(event)
var text = event.results[0][0].transcript;
if (analyzing == true) {
// 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();
@lmccart
lmccart / gist:532780549d49e36b5558
Last active November 25, 2020 01:55
face tracking with clmtrackr.js + p5.js
////////////////////////////////////////////////////////////////////
//// 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>
@lmccart
lmccart / gist:4a6cf3d92a7f00d32316
Last active September 28, 2017 18:24
face detection with processing and js
////////////////////////////////////////////////////////////////////
//// LIVE VIDEO
// Now we need the video library
import processing.video.*;
// Capture object
Capture img;
// New images from camera
@lmccart
lmccart / gist:6349e5f5a5d8ba5e78e6
Created March 10, 2015 20:12
alchemy + jquery
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) {