| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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
| { "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
| { "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }, | |
| { "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} }, | |
| { "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } } |
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
| ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime |
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
Show hidden characters
| { | |
| "cmd": ["/usr/local/bin/node", "$file"], | |
| "selector": "source.js" | |
| } |
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
| openChrome() { | |
| open -a "/Applications/Google Chrome.app" $1 | |
| } | |
| alias chrome=openChrome |
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
| <snippet> | |
| <content><![CDATA[ | |
| var ${1:var} = function (${2:params}) { | |
| ${3:body} | |
| }; | |
| ]]></content> | |
| <description>js function expression</description> | |
| <tabTrigger>varf</tabTrigger> | |
| <scope>source.js</scope> | |
| </snippet> |
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
| <snippet> | |
| <content><![CDATA[ | |
| if (${1:condition}) { | |
| ${2:body} | |
| } else { | |
| ${3:body} | |
| } | |
| ]]></content> | |
| <description>js if else</description> | |
| <tabTrigger>ifelse</tabTrigger> |
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 formatLongDate = function(date) { | |
| //input: js date object | |
| //output: user friendly long date string, eg: Monday, Oct 26, 2015, 3:11 PM | |
| var options = { | |
| weekday: "long", | |
| year: "numeric", | |
| month: "short", | |
| day: "numeric", | |
| hour: "2-digit", | |
| minute: "2-digit" |
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 getTimeDiff = function(date) { | |
| //input: js date object | |
| //output: returns how long ago the input date occured in a user friendly format | |
| var now = new Date().getTime(); | |
| var ms = (now - date.getTime()); | |
| var days = Math.round(ms / 86400000); // days | |
| var hrs = Math.round((ms % 86400000) / 3600000); // hours | |
| var mins = Math.round(((ms % 86400000) % 3600000) / 60000); // minutes | |
| if (days > 0) { |
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 getRandomInt (min, max) { | |
| return Math.floor(Math.random() * (max - min + 1)) + min; | |
| } |
OlderNewer