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
#!/usr/bin/env bash | |
showHelp() { | |
cat <<HELP | |
$0 [OPTIONS] | |
Enable or Disable the trackpad on T450 on Ubuntu. | |
Options: | |
-h, --help Print help screen |
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
#!/usr/bin/env bash | |
# Uncomment next line to test | |
# VARIABLE=10 | |
if [ -z ${VARIABLE+x} ]; then | |
echo "Variable \$VARIABLE is not set" | |
else | |
echo "Variable \$VARIABLE is set and has the value of => $VARIABLE" | |
fi |
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
# kill-all <NAME> | |
function kill-all() { | |
ps aux | grep $1| grep -v grep | awk '{print $2}'|xargs kill -s 9 | |
} |
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 dec2hexString(dec) { | |
return '0x' + (dec+0x10000).toString(16).substr(-4).toUpperCase(); | |
} |
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 foo() { | |
return new Promise(function(resolve) { | |
$.ajax({ | |
url: '...', | |
success: function(response) { | |
resolve(response); // Returning the response | |
} | |
}); | |
}); | |
} |
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
dpkg --get-selections > ~/installed_libs.txt |
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
#!/usr/bin/env bash | |
( speaker-test -t sine -f 1000 )& pid=$! ; sleep 0.2s ; kill -9 $pid |
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
var customMatchers = { | |
toBeGoofy: function(util, customEqualityTesters) { | |
return { | |
compare: function(actual, expected) { | |
if (expected === undefined) { | |
expected = ''; | |
} | |
var result = {}; | |
result.pass = util.equals(actual.hyuk, "gawrsh" + expected, customEqualityTesters); |
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
npm cache clean; \ | |
rm -Rf node_modules; \ | |
rm npm-shrinkwrap.json; \ | |
npm install; \ | |
rm -Rf node_modules; \ | |
npm install; \ | |
npm shrinkwrap; |
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
.DS_Store | |
tmp/ |