Skip to content

Instantly share code, notes, and snippets.

@ukris
ukris / FAMO.US - confetti
Created May 2, 2014 03:59
FAMO.US - NOOB Example using Modifier and Transform
define(function(require, exports, module) {
var matrix;
var x,y,rot,scale;
function confetti() {
for (var i=1;i<=colors.length;i++) {
x = Math.floor(Math.random() * 15) + 1
y = Math.floor(Math.random() * 10) + 1
@ded
ded / parallel.js
Created July 21, 2011 01:10
call multiple async methods in parallel and receive the result in a callback
function parallel() {
var args = Array.apply(null, arguments)
, callback = args.pop()
, returns = []
, len = 0
args.forEach(function (el, i) {
el(function () {
var a = Array.apply(null, arguments)
, e = a.shift()
if (e) return callback(e)