Skip to content

Instantly share code, notes, and snippets.

@mlhDevelopment
mlhDevelopment / mutex.js
Last active August 29, 2015 14:11 — forked from oivoodoo/mutex.js
Javascript Mutex, with encapsulation
var Mutex = function() {
var queues = [];
var locked = false;
this.isLocked = function() {
return locked;
};
// It was about this point where I realized I didn't really want a mutex. I wanted a lock check......
this.push = function(callback) {
var self = this;
@mlhDevelopment
mlhDevelopment / gist:f84f7297131705a63191
Last active September 28, 2015 21:34 — forked from andyoakley/gist:1651859
Pivot Example
# Rotates a vertical set similar to an Excel PivotTable
#
# Given $data in the format:
#
# Category Activity Duration
# ------------ ------------ --------
# Management Email 1
# Management Slides 4
# Project A Email 2
# Project A Research 1