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() { | |
FakeAPI = { | |
users: [ | |
{ | |
id: 1, | |
user: "user@example.com", | |
badges: _.times(5, function(i) { | |
var id = i + 1; | |
return { | |
id: id, |
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
// Readline style toggle comment | |
{ "keys": ["ctrl+forward_slash"], "command": "toggle_comment", "args": { "block": false } }, | |
// Readline fix select line up | |
{ "keys": ["ctrl+shift+p"], "command": "move", "args": { "by": "lines", "forward": false, "extend": true } }, | |
// Readline fix by word ends | |
{ "keys": ["alt+f"], "command": "move", "args": { "by": "word_ends", "forward": true } }, | |
{ "keys": ["alt+b"], "command": "move", "args": { "by": "word_ends", "forward": false } }, | |
// Readline fix select by word ends | |
{ "keys": ["shift+alt+b"], "command": "move", "args": { "by": "word_ends", "forward": false, "extend": true } }, | |
{ "keys": ["shift+alt+f"], "command": "move", "args": { "by": "word_ends", "forward": true, "extend": true } }, |
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
Show hidden characters
[ | |
// Cursor Movement | |
// ⌃F Forward by words | |
{ "keys": ["alt+f"], "command": "move", "args": { "by": "wordends", "forward": true } }, | |
// ⌃B Backward by words | |
{ "keys": ["alt+b"], "command": "move", "args": { "by": "words", "forward": false } }, | |
// ⌃A Beginning of line (soft) | |
{ "keys": ["ctrl+a"], "command": "move_to", "args": { "to": "bol" } }, |
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
//= require jquery | |
//= require support/expect | |
//= require support/sinon | |
//= require support/chai | |
//= require support/chai-jquery | |
//= require support/sinon-chai | |
//= require magic_lamp | |
//= require lodash | |
//= require application | |
//= require_self |
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
/* jshint esnext: true */ | |
var _ = require("lodash"); | |
App.createController("Friends", { | |
actions: ["index"], | |
all: function() { | |
this.cacheElements(); | |
this.registerEvents(); | |
}, |
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 myFunction = function() { | |
console.log("Hello World"); | |
}; | |
var myObject = { | |
myMethod: function() { | |
console.log("I'm a property of an object"); | |
} | |
}; |
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 myFunction = function() { | |
console.log("Hello World"); | |
}; | |
var callAnotherFunction = function(anotherFunction) { | |
anotherFunction(); | |
}; | |
callAnotherFunction(myFunction); // logs "Hello World" |
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 myFunction = function() { | |
console.log("Hello World"); | |
}; | |
myFunction.someProperty = "WTF!? a function with a property?"; | |
console.log(myFunction.someProperty); |
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 greeterCreator = function(greeting) { | |
return function(name) { | |
console.log(greeting + " " + name); | |
}; | |
}; | |
var helloGreeter = greeterCreator("Hello"); | |
helloGreeter("Chicago Web Conf"); |
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 tellSecrets = function() { | |
var secret = "shh, don’t tell anyone"; | |
return function() { | |
console.log(secret); | |
}; | |
}(); | |
tellSecrets(); | |
console.log(secret); // undefined |
OlderNewer