Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Runnells Dhaulagiri

View GitHub Profile
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
displayValue: Ember.computed('value', function() {
return this.get('value');
}),
actions: {
@Dhaulagiri
Dhaulagiri / support.js
Created Nov 23, 2016
support signature
View support.js
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3B%24('textarea#body').val(%24('textarea#body').val() %2B "%5Cn%5Cn Thanks%2C %5Cn Brian Runnells %5Cn Human Interface Team")%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
myObject: Ember.computed(function() {
return {
items: {
foo: "bar"
}
};
View controllers.application.js
import Ember from 'ember';
const { get, set } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
log(object, type) {
console.log(`the thing: ${object} from ${type}`);
},
@Dhaulagiri
Dhaulagiri / application.controller.js
Created Jan 8, 2016
duplicate class names in 1.13
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
View asset-rewrite-1.js
AssetRewrite.prototype.processString = function (string, relativePath) {
// Start timer
console.time(key);
var newString = string;
for (var i = 0, keyLength = this.assetMapKeys.length; i < keyLength; i++) {
var key = this.assetMapKeys[i];
// Start timer
console.time(key)
@Dhaulagiri
Dhaulagiri / asset-rewrite-2.js
Last active Dec 11, 2015
asset-rev-debugging
View asset-rewrite-2.js
AssetRewrite.prototype.processString = function (string, relativePath) {
var newString = string;
for (var i = 0, keyLength = this.assetMapKeys.length; i < keyLength; i++) {
var key = this.assetMapKeys[i];
// Start timer
console.time(key);
if (this.assetMap.hasOwnProperty(key)) {
/*
@Dhaulagiri
Dhaulagiri / ember-master-in-ember-cli-app.md
Last active Sep 14, 2015 — forked from rwjblue/ember-master-in-ember-cli-app.md
Developing on Ember master (linked locally), with an Ember CLI application.
View ember-master-in-ember-cli-app.md

From a terminal run the following commands:

git clone git@github.com:emberjs/ember.js
cd ember.js
npm install
npm start

While that is running open another terminal and run the following (starting from the ember.js folder you cloned a moment ago):

View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
currentWhen: 'foo bar'
});
@Dhaulagiri
Dhaulagiri / signature.js
Last active Aug 26, 2015
support signature
View signature.js
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3B%24('.public .form-control').val(%24('.public .form-control').val() %2B "%5Cn%5Cn Thanks%2C %5Cn Brian Runnells %5Cn Human Interface Team")%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()