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
var fallback = function(options){ | |
var numOfOptions = options.length; | |
if (numOfOptions == 2){ | |
return (options[0].length > 0)? options[0] : options[1]; | |
}else if (numOfOptions > 2){ | |
return fallback(options.slice(1)); | |
}else if (numOfOptions == 1){ | |
return options[0]; | |
}else{ | |
return $(); |
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
#!/bin/bash | |
# Might as well ask for password up-front, right? | |
sudo -v | |
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing. | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
# Example: do stuff over the next 30+ mins that requires sudo here or there. | |
function wait() { |