Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Just pressing random keys

Travis Hoover thoov

💻
Just pressing random keys
View GitHub Profile
View controllers.application\.js
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { connect, on } from '../decorators';
@connect('ws://foo.baz')
export default class ApplicationController extends Controller {
@service websocket;
}
@thoov
thoov / components.my-form.js
Created Apr 2, 2019
Disabled Button Example
View components.my-form.js
import Ember from 'ember';
import { computed } from '@ember/object';
export default Ember.Component.extend({
childInputs: null,
init() {
this._super(...arguments);
this.childInputs = Ember.A([ { isValid: false }, { isValid: false } ]);
},
@thoov
thoov / user.hbs
Last active May 8, 2018
Thought exercise on "Ember Controllerless"
View user.hbs
<p>{{data.firstName}}</p>
<p>{{data.lastName}}</p>
{{some-component user=data}}
<button {{action 'someAction' data.username}}>Trigger someAction</button>
@thoov
thoov / user.hbs
Created May 8, 2018
Thought exercise on "Ember Controllerless"
View user.hbs
<p>{{data.firstName}}</p>
<p>{{data.lastName}}</p>
{{some-component data}}
<button {{action 'someAction' data.username}}>Trigger someAction</button>
View keybase.md

Keybase proof

I hereby claim:

  • I am thoov on github.
  • I am thoov (https://keybase.io/thoov) on keybase.
  • I have a public key ASAbTcXto41w5gbslX6GC-d4VowkgCUXiPmSfOYNJK1P4go

To claim this, I am signing this object:

View Dockerfile
FROM node:8.5
WORKDIR /app
ADD . /app
RUN npm -q install
RUN npm -q install -g ember-cli
EXPOSE 4200
EXPOSE 49152
View components.foo-bar.js
import Ember from 'ember';
const { get } = Ember;
export default Ember.Component.extend({
name: 'Travis',
didReceiveAttrs() {
this._super(...arguments);
View controllers-bar.js
import Ember from 'ember';
import stateFor from 'ember-state-services/state-for';
export default Ember.Controller.extend({
data: stateFor('todos', 'model')
});
@thoov
thoov / application.hbs
Last active Aug 29, 2015
Ember Table built with compossible components. https://github.com/emberjs/ember.js/issues/11124
View application.hbs
{{#my-table model=arrayOfData as |table|}}
{{#my-column table=table header='FirstName'}}
{{firstName}}
{{/my-column}}
{{#my-column table=table header='LastName'}}
{{lastName}}
{{/my-column}}
@thoov
thoov / zeroFill.js
Last active Dec 23, 2015
Zero fill a javascript array
View zeroFill.js
// 20 is the number of zero filled places
var zeroFilledArray = new Array( 20 ).join( "0" ).split("");
You can’t perform that action at this time.