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
| // For more information see: http://emberjs.com/guides/routing/ | |
| App.Router.map(function() { | |
| this.resouce('plan', function() { | |
| this.resource('projects', function() { | |
| this.resource('project', {path: ':project_id'}) | |
| }); | |
| }); | |
| }); |
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
| 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
| // RESOURCES | |
| filteredContent: function() { | |
| var view = this; | |
| active_asset = view.get('settings.active_asset'), | |
| active_playlist = view.get('parentView.settings.active_playlist'), | |
| smart_playlist = ['all', 'pending_review', 'reviewed', 'approved'], | |
| content = view.get('context.resources'); | |
| view.set('activePlaylist', null); | |
| switch(active_playlist) { |
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
| LibraryAdapter = Ember.RESTAdapter.extend | |
| didFind: (record, id, data)-> | |
| if /^code:/.test(id) | |
| id = data.id | |
| record.load(id, data) |
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
| ArticlesRoute = Em.Route.extend({ | |
| model: function() { | |
| Article.find({page: 1}); | |
| return Article.all(); | |
| } | |
| }); | |
| ArticlesController = Em.ArrayController.extend({ | |
| currentPage: 1, |
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
| Library.BooksNewController = Ember.ObjectController.extend | |
| save: -> | |
| @get('model').save().then => | |
| @transitionToRoute('books.book', @get('model')) | |
| console.log 'here' | |
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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
NewerOlder