Skip to content

Instantly share code, notes, and snippets.

@therewasaguy
therewasaguy / docwatch.js
Last active September 5, 2023 16:34
p5.sound --> p5.js documentation watch script
/*
Documentation Watcher
This assumes a directory structure like...
./docwatch.js
./p5.js/ <repo>
./p5.js-sound/ <repo>
Usage:
- Run `node docwatch.js` in the root directory.
@therewasaguy
therewasaguy / docwatch-website.js
Last active September 5, 2023 16:35
watch p5, p5.js and p5.js-website repos and move a bunch of files around when changes are made
/*
This script watches p5.js-sound/src for changes,
then moves the built library to p5.js to generate documentation,
then moves the documentation and p5.sound library files to the p5.js-website repo.
Assumes a directory structure like...
./docwatch-website.js
./p5.js/
./p5.js-sound/
./p5.js-website/
@therewasaguy
therewasaguy / docwatch.js
Last active July 12, 2017 04:16
p5.sound documentation watch script
/*
Place this in the same directory as your p5.js, p5.js-sound, and p5.js-website repos.
Tested on nodejs version 6+
Usage:
- Run `node docwatch.js` in the root directory.
- Run `grunt watch` in p5.js-sound directory.
- Run `grunt run` in p5.js-website directory.
@therewasaguy
therewasaguy / keybase.md
Created December 7, 2016 15:54
keybase.md

Keybase proof

I hereby claim:

  • I am therewasaguy on github.
  • I am talkscheap (https://keybase.io/talkscheap) on keybase.
  • I have a public key whose fingerprint is D1F6 F4A0 D954 967A 4473 4163 B383 D3A8 E434 0151

To claim this, I am signing this object:

@therewasaguy
therewasaguy / elastic_beanstalk_external_sessions.md
Created April 16, 2016 15:16 — forked from mlconnor/elastic_beanstalk_external_sessions.md
Analaysis and recommendation for externalizing session in Elastic Beanstalk using Tomcat and memcached.

Session Management in an Autoscaling Environment

Problem Statement

User sessions in J2EE and LAMP stacks have traditionally been handled in memory by the application server handling the user request. Because of that, load balancers have been configured to use sticky sessions. By sticky sessions we mean that once the user has visited the site, they will be assigned an app server and will return to that server for subsequent requests. The load balancers typically handle that by referencing the users session cookie.

Elastic cloud environments differ from traditional server configurations in that they have a variable number of servers based on traffic loads whereas traditional configurations had a fixed number of servers. When traffic volumes decline it is necessary to vaporize servers. In doing so, we would lose user sessions (essentially forcing a logout) unless we come up with a new strategy for session management.

A new approach

After much research, it is clear that the best

@therewasaguy
therewasaguy / transcribe.js
Created March 4, 2016 23:14 — forked from antiboredom/transcribe.js
Transcribe video/audio using IBM Watson
var request = require('request');
var fs = require('fs');
var sox = require('sox');
var spawn = require('child_process').spawn;
var WATSON_USER = '';
var WATSON_PASS = '';
var url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize';
<!doctype html>
<html>
<head>
<script language="javascript" src="p5.js"></script>
<script language="javascript" src="p5.sound.js"></script>
<script language="javascript" src="p5.dom.js"></script>
<script language="javascript" src="sketch.js"></script>
@therewasaguy
therewasaguy / cam.js
Last active December 19, 2015 18:38
update
// shims
var requestAnimationFrame = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame;
var cancelAnimationFrame = window.cancelAnimationFrame ||
window.webkitCancelRequestAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelRequestAnimationFrame || window.mozCancelAnimationFrame ||
@therewasaguy
therewasaguy / index.html
Last active December 19, 2015 00:49
update
<!doctype html>
<html>
<head>
<script language="javascript" src="p5.js"></script>
<script language="javascript" src="p5.sound.js"></script>
<script language="javascript" src="p5.dom.js"></script>
<script language="javascript" src="sketch.js"></script>