- Twitter: @baaz
- Website or Blog: http://balinterdi.com
- Company: FullStack Consulting LLC
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 proxyPath = '/api'; | |
module.exports = function(app) { | |
// For options, see: | |
// https://github.com/nodejitsu/node-http-proxy | |
var proxy = require('http-proxy').createProxyServer({}); | |
var path = require('path'); | |
app.use(proxyPath, function(req, res, next){ | |
// Do not include root path in proxied request |
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 wait(value, timeout) { | |
return new Ember.RSVP.Promise(function(resolve, _) { | |
window.setTimeout(function() { | |
Ember.run(function() { | |
resolve(value); | |
}); | |
}, timeout); | |
}); | |
} |
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
Ember.Application.initializer({ | |
name: "i18n", // <- this | |
initialize: function(container, application) { | |
container.register('i18n:main', i18n); | |
} | |
}); | |
Ember.Application.initializer({ | |
name: "injectI18n", |
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 stuntAnalytics; | |
moduleFor('controller:song', 'Unit - Song controller', { | |
needs: [ | |
'controller:song' | |
], | |
setup: function() { | |
stuntAnalytics = MockAnalytics.create(); // create with a mock library, like sinon; | |
this.container.register('service:analytics', stuntAnalytics); | |
this.container.inject('controller', 'analytics', 'service:analytics'); |
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 App = Ember.Application.extend({ | |
(...) | |
reset: function() { | |
this.__container__.lookup('store:main').clearCache(); | |
this._super(); | |
}, | |
(...) | |
willDestroy: function() { | |
this.__container__.lookup('store:main').clearCache(); | |
this._super(); |
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 = Ember.Application.create(); | |
App.User = Ember.Object.extend({ | |
name: '' | |
}); | |
var cory = App.User.create({ name: "Cory Filibuster" }); | |
App.Badge = Ember.Object.extend({ | |
name: '', |