This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run the file contents in the correct scope or sandbox. Expose | |
// the correct helper variables (require, module, exports) to | |
// the file. | |
// Returns exception, if any. | |
Module.prototype._compile = function(content, filename) { | |
// Remove shebang | |
var contLen = content.length; | |
if (contLen >= 2) { | |
if (content.charCodeAt(0) === 35/*#*/ && | |
content.charCodeAt(1) === 33/*!*/) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -z "$1" ]; then | |
echo "Usage: provide a title argument." | |
exit -1 | |
else | |
title="$@" | |
fi | |
d=$(date +"%Y-%m-%d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on a gist by @rwaldron | |
// https://gist.github.com/2897761 | |
function privatize() { | |
var map = new WeakMap(); | |
return function private(obj) { | |
var data = map.get(obj); | |
if (!data) { | |
map.set(obj, data = {}); | |
} |