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 route = {controller: 'home', action: 'index'}; | |
var action = router.getAction(route); | |
var handler = router.getHandler(action, null, route); | |
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('underscore') | |
RendrBase = require('rendr/shared/base/model') | |
module.exports = class Base extends RendrBase | |
constructor: -> | |
super | |
@initRelations() | |
initRelations: -> | |
return unless @relations? |
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
http://a0.muscache.com/airbnb/press/pdf/世界中の空き部屋をシェアで旅行者に提供 _ 月刊「事業構想」2013年7月号.pdf |
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 polyglot = new Polyglot(...) | |
, eventEmitter = ...; | |
function updatePhrases(phrases) { | |
polyglot.extend(phrases); | |
eventEmitter.emit('polyglot:updatePhrases', phrases); | |
} |
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
//config/errorHandler.js | |
exports.logErrors = function(options) { | |
return function(err, req, res, next) { | |
// do something with options | |
console.error(err); | |
next(err); | |
}; | |
} |
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 quickLinks = quickLinks.map(formatQuickLink.bind(null, contactData)); | |
function formatQuickLink(contactData, quickLink) { | |
return {...}; | |
} |
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: function(params, callback) { | |
callback(new Error('Something went wrong.')); | |
} | |
}; | |
// Screenshot of error page | |
// http://cl.ly/image/32401t1g2I1a |
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 spec = { | |
collection: { | |
collection: 'Databases', | |
params: {database_name: params.database_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
$ make build | |
./node_modules/.bin/browserify entry.js -o bundle.js | |
Error: Cannot find module 'router.js' from '/Users/spike/code/router.js-browserify-example' |