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
; Reference: https://superuser.com/questions/1190329/can-i-switch-the-alt-and-ctrl-keys-on-my-keyboard | |
; Reference: https://www.experts-exchange.com/articles/2155/Keyboard-Remapping-CAPSLOCK-to-Ctrl-and-Beyond.html | |
; Location: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout | |
; Description: Remaps Left Windows (5b,e0) and Left Alt (38,00) keys | |
; Note: When using as a .reg file, remove top comment lines | |
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,5b,e0,38,00,38,00,5b,e0,00,00,00,00 |
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
Reference: https://superuser.com/questions/1190329/can-i-switch-the-alt-and-ctrl-keys-on-my-keyboard | |
Other useful key codes | |
``` | |
1d 00 Left Ctrl | |
1d e0 Right Ctrl | |
38 00 Left Alt | |
38 e0 Right Alt | |
5b e0 Left Windows Key | |
5c e0 Right Windows Key |
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
$ mocha | |
update README.md | |
update changelog.md | |
update package.json (bump version manually) | |
$ npm run build | |
$ static . | |
navigate to http://127.0.0.1:8080/test and verify all tests pass in the browser | |
$ git add -A && git commit -m "Prepare vx.x.x" | |
$ git tag vx.x.x | |
$ git push origin master --tags |
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
if | |
ps aux | grep "[g]nome-terminal" > /dev/null | |
then | |
xdotool windowactivate `xdotool search --onlyvisible --class gnome-terminal` | |
else | |
gnome-terminal & | |
fi |
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
if | |
ps aux | grep "[s]ublime_text" > /dev/null | |
then | |
xdotool windowactivate `xdotool search --onlyvisible --class sublime_text` | |
else | |
subl & | |
fi |
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
if | |
ps aux | grep "[c]hrome" > /dev/null | |
then | |
xdotool windowactivate `xdotool search --onlyvisible --class google-chrome` | |
else | |
google-chrome & | |
fi |
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
// Source: http://stackoverflow.com/questions/2593637/how-to-escape-regular-expression-in-javascript | |
RegExp.quote = function(str) { | |
return (str+'').replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); | |
}; |
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 alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; | |
var base = alphabet.length; // base is the length of the alphabet (58 in this case) | |
// utility function to convert base 10 integer to base 58 string | |
function encode(num) { | |
var encoded = ''; | |
while (num){ | |
var remainder = num % base; | |
num = Math.floor(num / base); | |
encoded = alphabet[remainder].toString() + encoded; |
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
function type(obj) { | |
var str = Object.prototype.toString.call(obj); | |
return str.substr(8, str.length - 9).toLowerCase(); | |
} | |
function isInteger(obj) { | |
return (obj | 0) === obj; // jshint ignore: line | |
} |
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
function requiredir(dir) { | |
var fullpath = path.resolve(__dirname, dir), | |
ret = {}, | |
filepath, | |
stat, | |
key; | |
fs.readdirSync(fullpath).forEach(function forEachFile(file) { | |
filepath = path.join(fullpath, file); | |
stat = fs.statSync(filepath); |
NewerOlder