This file contains 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 addMe(num){ | |
return num+num; | |
} | |
function memoMe(fn){ | |
var objs = {}; | |
return function(x){ | |
return (objs[x]) ? objs[x] : (objs[x] = fn.apply(void 0, arguments), objs[x]); | |
}; | |
} |
This file contains 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
// Simple Memoization - could use some work | |
function addMe(num){ | |
return num+num; | |
} | |
function memoMe(fn){ | |
var objs = {}; | |
return function(x){ | |
if(x in objs) | |
{ |
This file contains 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 power(x,y){ | |
var tmp=x; | |
if (y<1){ | |
return 1; | |
} | |
else{ | |
for(var i=0;i<y-1;i++){ | |
tmp=tmp*x; | |
} | |
return tmp; |
This file contains 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 class="container"> | |
<h3>Normal List:</h3> | |
<ul> | |
<li>Home</li> | |
<li>About</li> | |
<li>Contact</li> | |
</ul> | |
<hr> | |
<h3>Inline List</h3> | |
<ul class="inline-list"> |
This file contains 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 class="container">Scroll Down (I'm relative) | |
<div class="absolute"> | |
absolute | |
</div> | |
<div class="rel2">So am i</div> | |
<div class="fixed">fixed</div> | |
</div> |
This file contains 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 speak(name){ | |
return "Hello " + name; | |
} | |
Function.prototype.wrap = function(fn){ | |
var that = this; | |
console.log(that); | |
return function(arg2,arg3){ | |
return fn(that,arg2,arg3); | |
}; |
This file contains 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 class="green content--search"> | |
<section class="content"> | |
<form action="template-search-results.html" method="post" tabindex="-1"> | |
<div class="dropdown-wrapper"> | |
<input class="" placeholder="Name / Keyword"> | |
<div class="js-industry form--item"><span>Industry</span></div> | |
<div class="js-practice form--item"><span>Practice</span></div> | |
<div class="js-newstype form--item"><span>News Type</span></div> | |
</div> | |
</form> |
This file contains 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 class="green content--search"> | |
<section class="content"> | |
<form action="template-search-results.html" method="post" tabindex="-1"> | |
<div class="dropdown-wrapper"> | |
<input class="" placeholder="Name / Keyword"> | |
<div class="js-industry form--item"><span>Industry</span></div> | |
<div class="js-practice form--item"><span>Practice</span></div> | |
<div class="js-newstype form--item"><span>News Type</span></div> | |
</div> | |
</form> |
This file contains 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 Obj(name) { | |
var that = this; | |
this.name = name || "world"; | |
return { | |
name : "Peter", | |
greet1 : function (arg1) { | |
return arg1 + this.name; | |
}, | |
greet2 : function (arg1) { |
This file contains 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 plus(x){ | |
return function(y){ | |
return y+x; | |
}; | |
} | |
function minus(x){ | |
return function(y){ | |
return y-x; | |
}; |