This file contains hidden or 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
module.exports = function chain() { | |
var steps = Array.apply(null, arguments); | |
return function middleware(req, res, next) { | |
(function dequeue() { | |
var step = steps.shift(), | |
callback = steps.length ? function (err) { | |
if (err) { | |
return next(err); | |
} |
This file contains hidden or 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
function createUUID() { | |
return uuid.v4(); | |
} | |
// version 4 | |
// createUUID.regex = '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$'; | |
createUUID.regex = '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'; | |
createUUID.is = function (str) { | |
return new RegExp(createUUID.regex).test(str); |
This file contains hidden or 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
# https://github.com/lyze/posh-git-sh | |
# posh-git-sh (symbolic link from the posh-git-sh github repo is required first) | |
source ~/git-prompt.sh | |
# PROMPT_COMMAND='__posh_git_ps1 "\u@\h:\w" "\\\$ "' | |
PROMPT_COMMAND='__posh_git_ps1 "[\w]" "\\\$ "' |
This file contains hidden or 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
if | |
ps aux | grep "[g]nome-terminal" > /dev/null | |
then | |
xdotool windowactivate `xdotool search --onlyvisible --class gnome-terminal` | |
else | |
gnome-terminal & | |
fi |
NewerOlder