This file contains hidden or 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
| <VirtualHost *:80> | |
| ServerName "me.dev" | |
| DocumentRoot "/var/www/awc/me/public/" | |
| RewriteEngine On | |
| RewriteCond %{HTTP:Accept} text/html [NC] | |
| RewriteRule ^(.*)$ / | |
| RewriteRule ^/api/(.*)$ http://localhost:2403/$1 [P] | |
| </VirtualHost> |
This file contains hidden or 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.ApplicationRoute = Em.Route.extend | |
| model: -> | |
| Em.RSVP.hash | |
| users: store.find('user') | |
| setupController: (controller, context) -> | |
| @controllerFor('users').set('model', context.users) | |
| App.UsersController = Em.ArrayController.extend() |
This file contains hidden or 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.ApplicationRoute = Em.Route.extend | |
| model: -> | |
| store.find('user') | |
| setupController: (controller, users) -> | |
| @controllerFor('users').set('model', users) | |
| App.UsersController = Em.ArrayController.extend() | |
| App.FooController = Em.Controller.extend |
This file contains hidden or 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 'bundler/setup' | |
| Bundler.require | |
| # Gem versions: | |
| # celluloid (0.15.1) | |
| # celluloid-io (0.15.0) | |
| # nio4r (0.5.0) | |
| # timers (1.1.0) |
This file contains hidden or 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
| # Routes | |
| App.Router.map -> | |
| @resource 'post', path: "/posts/:post_id" | |
| App.PostRoute = Em.Route.extend | |
| model: (params) -> | |
| @store.find('post', params.post_id) | |
| App.PostIndexRoute = Em.Route.extend | |
| model: (params) -> |
This file contains hidden or 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
| // embedded | |
| { | |
| post: { | |
| title: "whatever", | |
| comments: [ | |
| { | |
| id: 1, | |
| comment: "something" | |
| } | |
| ] |
This file contains hidden or 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.Bands = Ember.ObjectProxy.extend(); | |
| App.Bands.reopenClass({ | |
| all: function() { | |
| return $.getJSON("http://domain.com/api/v1/bands?format=jsonp&callback=?").then(function (response) { | |
| return response.map(function (band) { | |
| return App.Bands.create({content: band}) | |
| }); | |
| }); | |
| } | |
| }); |
This file contains hidden or 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
| Admin.RefreshableModel = Em.Object.extend({ | |
| /** | |
| * Keeps reloading a given model from the server. To stop this process, just | |
| * kill the `timer` variable. | |
| */ | |
| reload: function(model) { | |
| if(this.timer) { this.stop(); } | |
| this.model = model; | |
| this.timer = Em.run.later(this, '_reload', 15000); |
This file contains hidden or 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
| model.get('foos').then (foos) -> | |
| foos.get('firstObject') |
This file contains hidden or 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.PushClient = Em.Object.extend | |
| init: -> | |
| @connection = connectToSocketIOSomehow() | |
| subscribe: (channel, callback) -> | |
| @connection.subscribe channel, callback | |
| App.register 'pushClient:main', App.PushClient | |
| App.inject 'router', 'pushClient', 'pushClient:main' # inject pushClient into router |