Skip to content

Instantly share code, notes, and snippets.

Devin Weaver sukima

Block or report user

Report or block sukima

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
@sukima
sukima / controllers.application.js
Created Jul 31, 2019
ember-metrics documentation error
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@sukima
sukima / adapters.application.js
Last active Jul 29, 2019
Relationships in ember-data serialization
View adapters.application.js
import JSONAPIAdapter from 'ember-data/adapters/json-api';
import { inject as service } from '@ember/service';
const LAST_ID_TAG = '_lastId';
export default JSONAPIAdapter.extend({
storage: service('fake-chrome-store'),
debug: service(),
generateIdForRecord(store, type) {
View compliments.js
// GistID: b3afe01b59ce579e20459e3b40a7eee6
class Complimentor {
static compliments() {
return new Complimentor().phrases();
}
phrases() {
return `${this.phrase()}. ${this.maybe(this.phrases)}`;
}
View link-finder.js
View components.hampster-image-manager.js
import Component from '@ember/component';
import { computed } from '@ember/object';
import { equal } from '@ember/object/computed';
export const HAMPSTER_IMAGES = Object.freeze([
'https://emberjs.com/images/brand/ember_Tomster-Lockup-b368131eb80ecbcbaf2d23fd4cb27295.png',
'https://emberjs.com/images/tomsters/chicago-zoey-ccedddece3b2142d4113757829c652aa.png'
]);
export default Component.extend({
@sukima
sukima / components.date-time-manager.js
Last active Jun 7, 2019
ember-observer-causing-an-issue
View components.date-time-manager.js
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
time: computed('datetime', function() {
let date = new Date(this.datetime);
return `${date.getHours()}:${date.getMinutes()}`;
}),
date: computed('datetime', function() {
View components.big-number-style-manager.js
import Component from '@ember/component';
import { computed } from '@ember/object';
import { scheduleOnce } from '@ember/runloop';
const { max, pow } = Math;
const FONT_SIZES = Object.freeze([null, null, null, 34, 26]);
export default Component.extend({
tagName: '',
@sukima
sukima / controllers.application.js
Created May 30, 2019
Working New Tests Template
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View components.item-display.js
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
tagName: 'span',
didInsertElement() {
this._super(...arguments);
this.logger.log(`${this.name} didInsertElement`, 'insert');
},
View controllers.application.js
import Ember from 'ember';
import { computed } from '@ember/object';
let idx = 0;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
foo: computed('bar.@each.baz.[]', function() {
return this.bar.mapBy('baz').reduce((a, b) => a.concat(b));
}),
You can’t perform that action at this time.