Skip to content

Instantly share code, notes, and snippets.

View twokul's full-sized avatar
😎
mischief, mostly.

Alex Navasardyan twokul

😎
mischief, mostly.
View GitHub Profile
import Ember from 'ember';
const MAX = 1157;
export default Ember.Component.extend({
tagName: 'rect',
attributeBindings: ['computedHeight:height'],
computedHeight: Ember.computed('facet.count', function() {
let facetCount = this.get('facet.count');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
series: Ember.computed(function() {
return [
null,
{ leftLimit: '67500.00', rightLimit: '72800.00', y: 26 },
null
@twokul
twokul / left.json
Created November 7, 2015 21:56
Ember CLI Release 1.13.9. `bower.json` diff.
{
"name": "my-addon",
"dependencies": {
"ember": "1.13.7",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "1.13.8",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
"ember-qunit": "0.4.9",
"ember-qunit-notifications": "0.0.7",
@twokul
twokul / user-factory.js
Last active August 29, 2015 14:22
Ember Data Factory Guy (sample factory)
FactoryGuy.define('user', {
default: {
firstName: 'David',
lastName: 'Hamilton'
}
});
// using `make` and `build` EDFG helpers
// make('user') => ED record
// build('user') => JSON payload
@twokul
twokul / ember-data-factory-guy-unit-test.js
Created June 2, 2015 06:41
ember-data-factory-guy-unit-test.js
import Ember from 'ember';
import { test } from 'ember-qunit';
import { moduleForComponent } from '../../helpers/ember-qunit';
import { build } from "../../helpers/factory-guy";
const run = Ember.run;
moduleForComponent('user-info-component', {
integration: true,
@twokul
twokul / reports.md
Last active August 29, 2015 14:20
reporting

Reports

for today:

  • reports route

  • report route (reports/1)

    • return this.store.find('report', 1)
  • report types (base types + custom ones)

    • what is a type? how do we sub-type?
  • use query params for everything

@twokul
twokul / output
Created May 2, 2015 19:14
output
/Users/alex/code/os/ember/ember-cli/node_modules/resolve/lib/core.js: 2ms
/Users/alex/code/os/ember/ember-cli/node_modules/resolve/lib/caller.js: 0ms
/Users/alex/code/os/ember/ember-cli/node_modules/resolve/lib/node-modules-paths.js: 1ms
/Users/alex/code/os/ember/ember-cli/node_modules/resolve/lib/async.js: 4ms
/Users/alex/code/os/ember/ember-cli/node_modules/resolve/lib/sync.js: 1ms
/Users/alex/code/os/ember/ember-cli/node_modules/resolve/index.js: 12ms
/Users/alex/code/os/ember/ember-cli/node_modules/exit/lib/exit.js: 1ms
/Users/alex/code/os/ember/ember-cli/node_modules/chalk/node_modules/escape-string-regexp/index.js: 0ms
/Users/alex/code/os/ember/ember-cli/node_modules/chalk/node_modules/ansi-styles/index.js: 1ms
/Users/alex/code/os/ember/ember-cli/node_modules/strip-ansi/node_modules/ansi-regex/index.js: 0ms
@twokul
twokul / use-lazy-image.hbs
Created February 9, 2015 02:39
lazy-loading-image-in-ember
{{lazy-image url='http://my-valid-url.com/foo.jpg'}}
{{#lazy-image url='http://my-valid-url.com/foo.jpg'}}
<!-- custom template goes here, spinner, svg, etc. -->
{{/lazy-image}}
{{lazy-image url='http://my-not-valid-url.com/foo.jpg' errorText='Something went wrong.'}}
@twokul
twokul / image-load-mixin.js
Created February 9, 2015 02:34
lazy-loading-image-in-ember
import Ember from 'ember';
import { set } from 'ember';
import computed from 'ember/computed';
var on = Ember.on;
var getWithDefault = Ember.getWithDefault;
export default Mixin.create({
loaded: false,
errorThrown: false,