Skip to content

Instantly share code, notes, and snippets.

View pixelhandler's full-sized avatar
🍊
Working remotely

Bill Heaton pixelhandler

🍊
Working remotely
View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
zipCode: '',
actions: {
lookup() {
let action = this.get('lookupAction');
let zipCode = this.element.querySelector('input').value;
return action(zipCode);
}
@pixelhandler
pixelhandler / bowling-with-monads.md
Last active January 18, 2018 23:06
Notes from a talk at Ember LA meetup on the topic of using a Maybe type and learning it via TDD of a bowling game.

Links from talk, Bowling with Monads

  • A practical example of TDDing a bowling game then refactoring to safely use undefined (& killing null too) with a "Maybe/Optional" type (a Monad).
  • About the game, Bowling 101

The source code

  • TDD bowling solution using a Maybe on branch safe-undefined, see [README][Maybe README].

Keybase proof

I hereby claim:

  • I am pixelhandler on github.
  • I am pixelhandler (https://keybase.io/pixelhandler) on keybase.
  • I have a public key ASAEFDcuGR8QqYRKeunSUC0dxGhb4N28wN5nzjEqKC6o0Ao

To claim this, I am signing this object:

import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'button',
click(evt) {
console.log('x-button click', evt); // will be torn down
this.get('onClick')(evt);
}
});
@pixelhandler
pixelhandler / init.vim
Created October 20, 2017 12:31
Neovim conifig ~\AppData\Local\nvim\init.vim
" ----------------------------------------------------------
" python venv
let g:python3_host_prog='C:\tools\pyvenvs\neovim\Scripts\python.exe'
let g:python_host_prog='C:\tools\pyvenvs\neovim\Scripts\python.exe'
" ----------------------------------------------------------
" Plug
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
call plug#begin('~\AppData\Local\nvim\plugs')
@pixelhandler
pixelhandler / init.vim
Created October 20, 2017 12:31
Neovim conifig ~\AppData\Local\nvim\init.vim
" ----------------------------------------------------------
" python venv
let g:python3_host_prog='C:\tools\pyvenvs\neovim\Scripts\python.exe'
let g:python_host_prog='C:\tools\pyvenvs\neovim\Scripts\python.exe'
" ----------------------------------------------------------
" Plug
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
call plug#begin('~\AppData\Local\nvim\plugs')
@pixelhandler
pixelhandler / root.controller.js
Last active September 8, 2017 18:39 — forked from mdentremont/root.controller.js
Query params not populated until child model resolves
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['test'],
test: '<not set by route yet>',
paramValue: 'Not set yet'
});
@pixelhandler
pixelhandler / index.controller.js
Created September 8, 2017 18:29 — forked from mdentremont/index.controller.js
Query param update during loading does nothing
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['test'],
test: "NOT SET YET",
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'form',
attributeBindings: ['name:id'],
submitText: 'nothing submitted',
submit(){
console.log('called submit');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});