Skip to content

Instantly share code, notes, and snippets.

View gist:240a2ca7eb95737a8ebc
wayspurrchen / server.js
Created Oct 22, 2014
Thin Node.js proxy server for front-end-only SPAs that need to make CORS requests
View server.js
// Node.js proxy server for CORS requests with single page, no-backend apps.
// Instructions:
// 1) Place file into your app directory
// 2a) If you don't have a package.json file in this directory, run "npm init" first
// 2b) Run "npm install --save express request query-string"
// 3) Run server with "node server.js"
// 4) Configure Express to use whatever folder you want to serve your site out of.
// By default, this will run out of whatever folder you have your server.js in,
// but you shouldn't do this since it'll make everything in this folder accessible,
wayspurrchen / controller.js
Created Oct 15, 2014
Johnny-Five Arduino UNO Pixel Iterator RGB LED Code
View controller.js
var five = require('johnny-five');
var keypress = require('keypress');
var gm = require('gm');
var board = new five.Board();
var fs = require('fs');
var PNG = require('pngjs').PNG;
function componentToHex(c) {
var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
View index.html
<!DOCTYPE html>
.container-one {
min-height: 200px;
background-color: white;
.container-two {
min-height: 200px;
View gist:ae7dbb4819c925a40f63
<!DOCTYPE html>
<script src=""></script>
<button id="scissors">scissors</button>
<button id="rock">rock</button>
<button id="paper">paper</button>
<h1 id="decision">OUTCOME GOES HERE</h1>
wayspurrchen / gist:b6fd4eb085edf54406b7
Last active Aug 14, 2021
Web Performance Optimization Techniques
View gist:b6fd4eb085edf54406b7
wayspurrchen / index.html
Created Aug 28, 2014
Quizzy sample code
View index.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script src="main.js"></script>
<div id="quiz-app"></div>
<script type="text/template" id="template-question">
wayspurrchen / callbackWrapper.js
Last active Aug 29, 2015
Code snippet that can wrap any function and give it the ability to run a callback
View callbackWrapper.js
var callbackCurrier = function(obj, funcName) {
var originalFunction = obj[funcName];
var callbackFunc = function() {
var args =, 0);
var callback = args.pop();
var returnValue = originalFunction.apply(obj, args);
if (callback) {