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
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
// Code | |
var foo = (function(){ | |
var index; | |
function log(){ |
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(){ | |
var index; | |
function log(){ | |
console.log(index); | |
} | |
function iterate(){ | |
log(); |
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
// 1. Write a class to support the following code: | |
var Person = funcion(name) { | |
this.name = name; | |
}; | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); | |
thomas.name // --> "Thomas" |
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
// 1. Write a class to support the following code: | |
var Person = funcion(name) { | |
this.name = name; | |
}; | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); | |
thomas.name // --> "Thomas" |
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 cachedSin(num) { | |
this.cache = this.cache || {}; | |
if(this.cache[num] != null) { | |
console.log('returning from cache...'); | |
return this.cache[num]; | |
} | |
return this.cache[num] = Math.sin(num); | |
} |
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 id="the_div"> | |
<ul id="the_list"> | |
<li id="the_item">Click me!</li> | |
</ul> | |
</div> | |
<p id="log"></p> | |
<script type="text/javascript" charset="utf-8"> | |
function log(string){ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<title>Multiple Pie Charts</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.4.5"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.4.5"></script> | |
<style type="text/css"> | |
body { text-align: center } | |
path { stroke: #fff; stroke-width: 4px; } |
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
var request = new Y.JSONPRequest(toolBarUri, { | |
on: { | |
success: Y.bind(function(response) { | |
Y.log("Parsing toolbar configuration", 'info', 'modelDashboard'); | |
return response; | |
}, this), | |
failure: Y.bind(function(e) { | |
Y.log("Failed to get toolbar for dashboard.", "error", "modelDashboard"); |
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
Running Primrose specs | |
-------------------------- | |
-=> enter, level: 0 | |
Matchers | |
-=> enter, level: 1 | |
toBe | |
-=> enter, level: 2 | |
it asserts simple matches | |
-=> enter, level: 3 | |
beforeEach |
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
using System.Html; | |
using System.Runtime.CompilerServices; | |
using jQueryApi; | |
[Mixin("$.fn")] | |
public static class TextPreviewerjQueryPlugin | |
{ | |
public static jQueryObject TextPreviewerjQuery(TextPreviewerjQueryOptions options) | |
{ | |
return jQuery.Current.Each(delegate(int i, Element element) | |
{ |
OlderNewer