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 name = 'Bob'; | |
var Person = function(name){ | |
this.name = name; | |
console.log(name); | |
} | |
var me = Person('John'); | |
console.log(name); |
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 Person(name) { | |
this.name = name; | |
} | |
Person.prototype = { | |
hello : function() { | |
return "Hello, " + this.name; | |
} | |
}; |
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 http = require('http'), | |
fs = require('fs'), | |
jsdom = require('jsdom'), | |
mustache = require('mustache'); | |
var global = this; | |
var trips = [ | |
{ |
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
/** | |
* This is intended to be a simple behavior mixin that allows Backbone-style event delegation to be added to any object's prototype. | |
* | |
* Use: | |
* | |
* function MyView(){ this.$el = $('#my_view'); this.delegateEvents(); } | |
* $.extend(MyView.prototype, Eventable); | |
* MyView.prototype.events = {'click a.close': 'close'}; | |
* MyView.prototype.close = function(){ this.$el.hide(); } | |
* |
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
... | |
bundle = browserify() | |
bundle.addEntry('./assets/coffeescripts/lib/renderer.coffee') | |
src = bundle.bundle() | |
fs.writeFileSync @config.coffeePath, src, 'utf8' | |
... |
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
// modifierKey used to check if cmd+click, shift+click, etc. | |
!function($, global){ | |
var $doc = $(document); | |
var keys; | |
global.modifierKey = false; | |
global.keys = keys = { | |
'UP': 38, | |
'DOWN': 40, |
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
| app | |
|-- collections | |
|-- controllers | |
|-- helpers | |
|-- models | |
|-- templates | |
|-- views |
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
module.exports = | |
index: (params, callback) -> | |
fetchSpec = | |
collection: {collection: 'Users', params: params} | |
@app.fetcher.fetch fetchSpec, (err, results) -> | |
callback(err, 'users_index_view', results) | |
show: (params, callback) -> | |
fetchSpec = |
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
module.exports = (match) -> | |
match 'users/:id', 'users#show' | |
match 'users', 'users#index' | |
match 'listings/:id', 'listings#show' | |
match 'search', 'listings#search', maxAge: 900 |
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
BaseView = require('rendr/base/view') | |
_ = require('underscore') | |
module.exports = class ListingView extends BaseView | |
# Straight outta Backbone.View | |
tagName: 'section' | |
className: 'listing clearfix' | |
events: | |
'click .book_it': 'clickBookIt' |
OlderNewer