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
//events - a super-basic Javascript (publish subscribe) pattern | |
var events = { | |
events: {}, | |
on: function (eventName, fn) { | |
this.events[eventName] = this.events[eventName] || []; | |
this.events[eventName].push(fn); | |
}, | |
off: function(eventName, fn) { | |
if (this.events[eventName]) { |
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
# _utils.sh --- Utilities used across all the scripts. | |
set -e | |
set -o pipefail | |
# Prints spaces as a prefix to the command's output. | |
function prefixed { | |
sed -e "s/^/ /" | |
} |
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
<?php | |
/* | |
* @author: Juan S. Simon | |
* @copyright: none, just please don't try to sell it, they'll laugh at you... | |
* | |
*/ | |
if (php_sapi_name() != 'cli') { | |
exit("No web access allowed!" . PHP_EOL); | |
} |