Skip to content

Instantly share code, notes, and snippets.

Robert Jackson rwjblue

Block or report user

Report or block rwjblue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
stuff: ['grapes', 'animals', 'cheese'],
selectedStuff: ['animals'],
actions: {
toggleThing(thing){
if(this.get('selectedStuff').contains(thing)){
console.log('remove ' + thing);
@rwjblue
rwjblue / application.controller.js
Created Aug 28, 2015 — forked from KTKate/application.controller.js
Why Won't my component click
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
didIClick: 'No Clicks!'
});
@rwjblue
rwjblue / 01_default_export.js
Last active Aug 29, 2015
ES6 Module Syntax
View 01_default_export.js
// car.js
export default function Car() {
this.wheels = 4;
this.mirrors = 3;
}
// vehicles.js
import Car from './car'
View 01_basic_usage.js
var promise = new Promise(function(resolve, reject) {
// on success
resolve(value);
// on failure
reject(reason);
});
promise.then(function(value) {
// on fulfillment
@rwjblue
rwjblue / version-test.js
Created Feb 13, 2014
Using semver in node.js to confirm dependency ranges.
View version-test.js
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'));
View bunder_version_testing.rb
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
View get_dependent_keys.js
function getDependentKeys(object, propertyNameBeingInspected) {
var meta = metaFor(object),
deps = Ember.get(meta, 'deps.' + propertyNameBeingInspected);
return Ember.keys(deps);
}
View lazy_load.js
Ember.runLoadHooks = function(name, object) {
loaded[name] = object;
if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === "function") {
var event = new CustomEvent(name, {detail: object, name: name});
window.dispatchEvent(event);
}
if (loadHooks[name]) {
forEach.call(loadHooks[name], function(callback) {
View Assetfile
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
View beautified.js
/*!
* @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 () {
You can’t perform that action at this time.