View Install bash-completion on Amazon Linux
# Install bash-completion on Amazon Linux
sudo rpm -ivh bash-completion-20060301-1.noarch.rpm
rm bash-completion-20060301-1.noarch.rpm
. /etc/bash_completion
View waterfall-simple.js
function waterfall() {
var args = [];
var next = args.shift();
if (!next) return;
next(); // @todo: check if it's a Promise
setTimeout(function() { waterfall.apply(null, args); }, 100);
// Sample usage:
# Bash completion for Yeoman generators - tested in Ubuntu, OS X and Windows (using Git bash)
function _yo_generator_complete_() {
# local node_modules if present
local local_modules=$(if [ -d node_modules ]; then echo "node_modules:"; fi)
# node_modules in /usr/local/lib if present
local usr_local_modules=$(if [ -d /usr/local/lib/node_modules ]; then echo "/usr/local/lib/node_modules:"; fi)
# node_modules in user's Roaming/npm (Windows) if present
local win_roam_modules=$(if [ -d $(which yo)/../node_modules ]; then echo "$(which yo)/../node_modules:"; fi)
# also, node_modules in nodebrew current
local nodebrew_modules=$(if [ -d ${HOME}/.nodebrew/current/lib/node_modules ]; then echo "${HOME}/.nodebrew/current/lib/node_modules:"; fi)
View CommentSection
/* ${1:<Section Name>}
-------------------------------------------------------------------------- */
# Run this one-liner from the Sublime Text console if you need to revert all open documents
[ view.run_command('revert') for view in sublime.Window.views(sublime.active_window()) ]