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 memo(func){ | |
| var cache = {}; | |
| return function(){ | |
| var key = JSON.stringify(arguments); | |
| if (cache[key]){ | |
| console.log(cache) | |
| return cache[key]; | |
| } | |
| else{ | |
| val = func.apply(null, arguments); |
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 more functional memoizer | |
| //We can beef up our module by adding functions later | |
| var Memoizer = (function(){ | |
| //Private data | |
| var cache = {}; | |
| //named functions are awesome! | |
| function cacher(func){ | |
| return function(){ | |
| var key = JSON.stringify(arguments); |
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 memo(func){ | |
| var cache = {}; | |
| return function(){ | |
| var key = JSON.stringify(arguments); | |
| if (cache[key]){ | |
| console.log(cache) | |
| return cache[key]; | |
| } | |
| else{ | |
| val = func.apply(null, arguments); |
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 fib = memo(function(n) { | |
| if (n < 2){ | |
| return 1; | |
| }else{ | |
| //We'll console.log a loader every time we have to recurse | |
| console.log("loading..."); | |
| return fib(n-2) + fib(n-1); | |
| } | |
| }); |
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
| <div id="fullpage"> | |
| <div class="section"></div> | |
| <div class="section"></div> | |
| <div class="section"></div> | |
| <div class="section"></div> | |
| </div> |
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
| <div id="fullpage"> | |
| <div class="section"></div> | |
| <div class="slide"></div> | |
| <div class="slide"></div> | |
| <div class="slide"></div> | |
| </div> | |
| </div> |
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
| <div id="fullpage"> | |
| <div class="section"></div> | |
| <div class="slide"></div> | |
| <div class="slide"></div> | |
| <div class="slide"></div> | |
| </div> | |
| </div> |
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
| $(document).ready(function(){ | |
| $(#fullpage).fullpage(); | |
| }); |
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
| $(document).ready(function(){ | |
| $('#fullpage').fullpage({ | |
| //Navigation | |
| menu: '#menu', | |
| lockAnchors: false, | |
| anchors:['firstPage', 'secondPage'], | |
| navigation: false, | |
| navigationPosition: 'right', | |
| navigationTooltips: ['firstSlide', 'secondSlide'], |