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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
didIClick: 'No Clicks!' | |
}); |
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
// car.js | |
export default function Car() { | |
this.wheels = 4; | |
this.mirrors = 3; | |
} | |
// vehicles.js | |
import Car from './car' |
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 promise = new Promise(function(resolve, reject) { | |
// on success | |
resolve(value); | |
// on failure | |
reject(reason); | |
}); | |
promise.then(function(value) { | |
// on fulfillment |
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
semver = require('semver'); | |
console.log('Allows 2.0.0: ' + semver.satisfies('2.0.0', '~1.0.0')); | |
console.log('Allows 1.3.0: ' + semver.satisfies('1.3.0', '~1.0.0')); | |
console.log('Allows 1.2.0: ' + semver.satisfies('1.2.0', '~1.0.0')); | |
console.log('Allows 1.1.0: ' + semver.satisfies('1.1.0', '~1.0.0')); | |
console.log('Allows 2.0.0: ' + semver.satisfies('2.0.0', '~1')); | |
console.log('Allows 1.3.0: ' + semver.satisfies('1.3.0', '~1')); |
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
required_version = '~> 1.4.beta' | |
comparison_version = '1.5.0' | |
if Gem::Requirement.new(required_version) =~ Gem::Version.new(comparison_version) | |
puts "Specifying #{required_version} will allow upgrading to #{comparison_version}." | |
else | |
puts "Specifying #{required_version} will NOT allow upgrading to #{comparison_version}." | |
end |
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 getDependentKeys(object, propertyNameBeingInspected) { | |
var meta = metaFor(object), | |
deps = Ember.get(meta, 'deps.' + propertyNameBeingInspected); | |
return Ember.keys(deps); | |
} |
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
/*! | |
* @overview Ember - JavaScript Application Framework | |
* @copyright Copyright 2011-2014 Tilde Inc. and contributors | |
* Portions Copyright 2006-2011 Strobe Inc. | |
* Portions Copyright 2008-2011 Apple Inc. All rights reserved. | |
* @license Licensed under MIT license | |
* See https://raw.github.com/emberjs/ember.js/master/LICENSE | |
* @version 1.6.0-beta.1+canary.4686c4da | |
*/ | |
! function () { |
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 'ember-dev' | |
distros = { | |
"runtime" => %w(ember-metal rsvp container ember-runtime), | |
"template-compiler" => %w(ember-handlebars-compiler), | |
"data-deps" => %w(ember-metal rsvp container ember-runtime), | |
"full" => %w(ember-metal rsvp container ember-runtime ember-views metamorph handlebars ember-handlebars-compiler ember-handlebars ember-routing ember-application ember-extension-support) | |
} | |
class AddMicroLoader < Rake::Pipeline::Filter |
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
// So you likely have an application adapter like so: | |
App.ApplicationAdapter = DS.ActiveModelAdapter.extend(); // could also be REST adapter | |
// And you have a model: | |
App.Comment = DS.Model.extend({ | |
text: DS.attr(), | |
createdBy: DS.attr() | |
}); |
OlderNewer