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 foo = new String(Math.random()); | |
| var bar = foo.substring(2, 12); | |
| console.log(bar) |
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
| /** | |
| * Created by Michael 7/20/15 | |
| */ | |
| var FF = FF || {}; | |
| /** | |
| * FF - drawers.js | |
| * | |
| * Sets up funcionality necessary to make the left and right slideout drawers work |
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
| $('.selector').on('click', function() { | |
| $(this).addClass('addPulse'); | |
| }) |
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
| Usage | |
| ctrl-alt-l launch live server on port 3000. | |
| ctrl-alt-q stop live server. | |
| ctrl-alt-3 launch live server on port 3000. | |
| ctrl-alt-4 launch live server on port 4000. |
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 a, b, temp; | |
| a = 0; | |
| b = 1; | |
| temp = b; | |
| for (i = 0; i < 20; i++) { | |
| console.log(temp); | |
| temp = a + b; | |
| a = b; |
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
| for (var i = 0; i < 101; i++){ | |
| console.log(i); | |
| if (i % 3 === 0 && i % 5 === 0) | |
| console.log("fizzbuzz"); | |
| else if | |
| (i % 5 === 0) | |
| console.log("buzz"); | |
| else if | |
| (i % 3 === 0) | |
| console.log("fizz"); |
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 isPalindrome(str){ | |
| var nospace = str.split(' ').join(''); | |
| var len = nospace.length; | |
| for (var i = 0; i < len/2; i++) { | |
| if (nospace[i] !== nospace[len -1 -i]) | |
| return false; | |
| } | |
| return true; | |
| } | |
| isPalindrome('he, a man a plan a canal panama, eh'); |
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 install -g yo | |
| $ npm install -g generator-angular | |
| $ mkdir myProject && cd $_ | |
| $ yo angular myProject | |
| $ yo angular:route main // generate a controller and a view and put them into a route (to main.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
| Array.prototype.nSort = nSort; | |
| // [].prototype.nSort works too | |
| function nSort(){ | |
| return this.sort( | |
| function numSort(n1, n2){ | |
| if (n1 < n2) return -1; | |
| if (n1 > n2) return 1; | |
| return 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
| vendor(prop, args) | |
| -webkit-{prop} args | |
| -moz-{prop} args | |
| -ms-{prop} args | |
| -o-{prop} args | |
| {prop} args | |
| border-radius() | |
| vendor('border-radius', arguments) |
NewerOlder