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
| http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml | |
| http://benalman.com/news/2012/05/multiple-var-statements-javascript/ | |
| https://www.reddit.com/r/javascript/comments/15m252/best_javascript_coding_style_guide_i_have_found/ | |
| http://blog.founddrama.net/2010/08/annotated-google-javascript-style-guide/ | |
| Single quotes versus double: | |
| http://stackoverflow.com/questions/242813/when-to-use-double-or-single-quotes-in-javascript | |
| http://www.2ality.com/2012/09/javascript-quotes.html |
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
| A spot of code is referentially transparent when it can be substituted for its evaluated value without changing the behavior of the program. | |
| https://github.com/DrBoolean/mostly-adequate-guide/blob/master/ch3.md |
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
| https://github.com/DrBoolean/mostly-adequate-guide/blob/master/ch3.md | |
| var immutableState = Object.freeze({ | |
| minimum: 21 | |
| }); |
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 log --> obtain commit id | |
| git branch newbranch | |
| git reset --hard a1b2c3d4 | |
| (git checkout newbranch) if need be | |
| http://stackoverflow.com/questions/1628563/move-the-most-recent-commits-to-a-new-branch-with-git | |
| Two push issues: | |
| 1) On master when doing push you get following error: |
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
| BOOKMARK | |
| Toggle: CMD F2 | |
| Next: F2 | |
| GOTO | |
| Functions etc: CMD R | |
| EDIT NAVIGATION | |
| PREV EDIT: CMD SHFT OPT K | |
| NEXT EDIT: CMD SHFT OPT J |
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
| Score = namedtuple("Score", 'Id W L D') | |
| p1s = Score(p1, 1, 0, 0) | |
| p2s = Score(p2, 0, 1, 0) | |
| c.execute("update players set wins = wins + {0.W}, losses = losses + {0.L}, draws = draws + {0.D} where id={0.Id}".format(p1s)) |
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
| https://stackoverflow.com/questions/24472596/git-fatal-pathspec-is-in-submodule/24473037#24473037 | |
| Problem: | |
| I was unable to commit changes to a repository I cloned as a subdirectory to my existing project directory. | |
| ✘ ☪ ~/Documents/Python master± git add fullstack/vagrant/forum/*.* | |
| fatal: Pathspec 'fullstack/vagrant/forum/forum.py' is in submodule 'Python/fullstack' | |
| In this case, Python is the main project directory I would commit to github. | |
| fullstack is a repo I cloned from udacity as a subdirectory. |
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
| http://christoph.ruegg.name/blog/git-howto-revert-a-commit-already-pushed-to-a-remote-reposit.html | |
| git push origin +2f90b076c3c8349adca4883497a24aed4d8d4a54^:master |
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
| fun c2s (s,r) = | |
| let val r = Int.toString r | |
| in case s of | |
| Spade => " (Spade,"^r^")" | |
| | Heart => " (Heart,"^r^")" | |
| | Diamond => " (Diamond,"^r^")" | |
| | Club => " (Club,"^r^")" | |
| end | |
| fun cl2s lst = List.foldl (fn(c,acc)=> acc^(c2s c)) "" lst |
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
| (*Source: http://www.webber-labs.com/mpl/source%20code/Chapter%20Twelve/quicksort.sml.txt *) | |
| fun quicksort nil = nil | |
| | quicksort (pivot :: rest) = | |
| let | |
| fun split(nil) = (nil,nil) | |
| | split(x :: xs) = | |
| let | |
| val (below, above) = split(xs) | |
| in | |
| if x < pivot then (x :: below, above) |