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
| _.each( '<collection>', function(item,count,collection) { | |
| // do stuff | |
| }, this /* this becomes available in your function */); |
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
| # directory goes back to the hash, ALL changes AFTER hash are discarded. | |
| # you can always merge in a different branch to update later changes. | |
| git checkout -b <temp-branch-name> <myHashGoesHere> | |
| # OR | |
| # create a new branch | |
| git checkout -b <temp-branch-name> | |
| # reverts all files that were originally part of this hash back to their |
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
| # git push -u origin my_branch | |
| git push -u [email protected]:name-of-repo.git my-branch | |
| # same as: | |
| git push --set-upstream [email protected]:name-of-repo.git my-branch |
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
| // Create the function | |
| // 'a' and 'b' are the arguments available to the function, | |
| // the last string is the body of your new function | |
| var x = Function('a','b','console.log(a+b); return "apples";'); | |
| // Implementation | |
| x(1,2); // will return 'apples' and will log to the console '3'; |
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
| #!/bin/bash | |
| git fetch | |
| git add --all . | |
| git status | |
| git commit -m "$2" | |
| git push |
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
| # bower install <name-for-your-directory>=http://<url>/<file-name> -S | |
| # example | |
| bower install dom4-polyfill=https://raw.githubusercontent.com/WebReflection/dom4/master/build/dom4.js -S |
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
| # mklink /j <directory/shortcut name> <directory to create the link to> | |
| mklink /j OPUSConfirmationsTrunk_v2.0 C:\Users\grobles4\workspace\OPUSConfirmationsTrunk_v2.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
| # spin up node-inspector, here i'm pointing it to a specific port | |
| node-inspector --web-port=8081 | |
| # open another terminal, start the node app with the --debug-brk option | |
| # to create a breakpoint on line 1 of your app | |
| node --debug-brk ./app.js | |
| # if debugging Gruntfile.js with Windows, use: | |
| node --debug-brk c:\Users\<username>\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt <taskname> |
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
| # find and copy the: file name, hash of change | |
| git whatchanged | |
| # show the diff | |
| # e.g. git diff ee11453 src/js/my-module.js | |
| git diff <hash> <path/filename> | |
| # when you see this: @@ -26,31 +26,31 @@ | |
| # "-26" is the line number, | |
| # "31" is the number of lines changed |
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
| node_modules/ | |
| bower_components/ | |
| *.log | |
| build/ | |
| dist/ | |
| ########################################################## | |
| # ignore everything inside this directory |