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
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));
}),
@sukima
sukima / adapters.application.js
Last active Jun 17, 2019
[discus] REST API Example
View adapters.application.js
import RESTAdapter from 'ember-data/adapters/rest';
export default RESTAdapter.extend({
namespace: '/api'
});
@sukima
sukima / .gitignore
Last active May 22, 2019
Failing testdouble TypeScript issue
View .gitignore
/node_modules
test.js
You can’t perform that action at this time.