Skip to content

Instantly share code, notes, and snippets.

View thoov's full-sized avatar
🤔
Is the Kool-Aid man the glass part or the liquid?

Travis Hoover thoov

🤔
Is the Kool-Aid man the glass part or the liquid?
View GitHub Profile
@thoov
thoov / cookie.js
Created May 21, 2011 18:24
Javascript Cookie Functions
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 April 2, 2019 05:09
Disabled Button Example
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 15:50
Thought exercise on "Ember Controllerless"
<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 06:00
Thought exercise on "Ember Controllerless"
<p>{{data.firstName}}</p>
<p>{{data.lastName}}</p>
{{some-component data}}
<button {{action 'someAction' data.username}}>Trigger someAction</button>

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:

FROM node:8.5
WORKDIR /app
ADD . /app
RUN npm -q install
RUN npm -q install -g ember-cli
EXPOSE 4200
EXPOSE 49152
@thoov
thoov / components.foo-bar.js
Created June 18, 2016 17:31
Render Function
import Ember from 'ember';
const { get } = Ember;
export default Ember.Component.extend({
name: 'Travis',
didReceiveAttrs() {
this._super(...arguments);
@thoov
thoov / zeroFill.js
Last active December 23, 2015 00:38
Zero fill a javascript array
// 20 is the number of zero filled places
var zeroFilledArray = new Array( 20 ).join( "0" ).split("");
function Promise(promise) {
if (promise instanceof Promise) {
return promise;
} else {
// this is a new promise chain
this.callbacks = [];
}
}
Promise.prototype.then = function(callback_ok, callback_error) {