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
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js | |
var BoundHelperView = Ember._MetamorphView.extend({ | |
context: null, | |
options: null, | |
property: null, | |
// paths of the property that are also observed | |
propertyPaths: [], | |
value: Ember.K, |
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
namespace :rubber do | |
namespace :pdf do | |
after "rubber:install_packages", "rubber:pdf:install_wkhtmltopdf" | |
desc "install wkhtmltopdf see http://stackoverflow.com/questions/9672070/wicked-pdf-on-production-server/9687535#9687535 for details" | |
task :install_wkhtmltopdf, roles: :app do | |
sudo_script 'install_wkhtmltopdf', <<-ENDSCRIPT | |
if ! which wkhtmltopdf &> /dev/null; then | |
apt-get install -y wkhtmltopdf | |
apt-get remove -y wkhtmltopdf --purge |
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.Router = Em.Router.extend({ | |
root: Em.Route.extend({ | |
route: '/', | |
user: Em.Route.extend({ | |
route: '/:user_id/', | |
connectOutlets: function (router, context) { | |
//What is context here? | |
// it's simple in the one segment case where | |
// its the return value of find on the model. | |
}, |
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.Forms.ImageUploader = Ember.View.extend | |
classNames: ['ember-image-uploader'] | |
controller: null | |
didInsertElement: -> | |
controller = @get('controller') | |
if controller.get('imageUploadUrl') | |
@initUploader() | |
else | |
@get('controller').addObserver 'imageUploadUrl', => | |
if @get('controller.imageUploadUrl') |
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
<script type="text/x-handlebars"> | |
<button {{action loadBooks target="Welcome.booksController"}}>Load Books</button> | |
{{#collection contentBinding="Welcome.booksController" tagName="ul"}} | |
<b>{{view.content.title}}</b> - {{view.content.author}}, <i>{{view.content.genre}}</i> | |
{{/collection}} | |
</script> |
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
#!/usr/bin/env ruby | |
VERSION_REGEX = /\((\d.+)\)/ | |
require 'net/http' | |
require 'json' | |
lines = `git diff Gemfile.lock`.split("\n") | |
# Line is a diffed line | |
lines.select!{ |line| ['+ ', '- '].include?(line.strip[0..1])} | |
# Line has a version | |
lines.select!{ |line| line.match(VERSION_REGEX) } |
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() { | |
window.DS = Ember.Namespace.create({ | |
// this one goes to 11 | |
CURRENT_API_REVISION: 11 | |
}); | |
})(); | |
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
// ========================================================================== | |
// Project: Ember Data | |
// Copyright: ©2011-2012 Tilde Inc. and contributors. | |
// Portions ©2011 Living Social Inc. and contributors. | |
// License: Licensed under MIT license (see license.js) | |
// ========================================================================== | |
// Last commit: eaffebc (2013-02-10 08:36:19 -0800) |
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 spec_helper | |
#= require models/user | |
describe "User", -> | |
beforeEach -> | |
@user = App.User.createRecord | |
firstName: 'Bart' | |
lastName: 'Simpson' | |
roles: 'user,admin' | |
describe "name", -> |