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
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
// Add this to your C# console app's Main method to give yourself | |
// a CancellationToken that is canceled when the user hits Ctrl+C. | |
var cts = new CancellationTokenSource(); | |
Console.CancelKeyPress += (s, e) => | |
{ | |
Console.WriteLine("Canceling..."); |
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
SELF=${0##*/} | |
die() { | |
log "$@" | |
exit 1 | |
} | |
log() { | |
printf "$SELF: %s\n" "$@" >&2 | |
} |
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
/** | |
* Changes value to past tense. | |
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc. | |
* http://jsfiddle.net/bryan_k/0xczme2r/ | |
* | |
* @param {String} value The value string. | |
*/ | |
Vue.filter('past-tense', function(value) { | |
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing | |
var vowels = ['a', 'e', 'i', 'o', 'u']; |
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
start on started network | |
script | |
for interface in $(cut -d: -f1 /proc/net/dev | tail -n +3); do | |
logger -t 'wakeonlan init script' enabling wake on lan for $interface | |
ethtool -s $interface wol g | |
done | |
end script |