Skip to content

Instantly share code, notes, and snippets.

{{yield
(hash
install=this.install
state=this.state
)
}}
@jgwhite
jgwhite / moon-songs.json
Last active December 31, 2020 12:52
moon-songs
This file has been truncated, but you can view the full file.
[
{
"id": "3c339d3d-c76d-3eb5-b3bc-98c8c2d18620",
"type": "Song",
"score": 99,
"title": "Blue Moon",
"language": "eng",
"iswcs": [
"T-915.741.665-4",
"T-070.011.746-9"
@jgwhite
jgwhite / controllers.application\.js
Last active July 22, 2020 09:09
Modifier Forwarding Demo
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
@tracked actionClicked = false;
@tracked onclickClicked = false;
@tracked onClicked = false;
@action enable(prop) {
import Component from '@glimmer/component';
export default class extends Component {
}
@jgwhite
jgwhite / controllers.application\.js
Last active June 25, 2020 15:08
guid-for helper
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@jgwhite
jgwhite / SketchSystems.spec
Last active December 19, 2019 17:26
Bindings
Bindings
No bindings
add binding -> Selecting target
Selecting target
bind -> Sending request
done -> No bindings
Selecting target with error
try again -> Sending request
done -> No bindings
Sending request
@jgwhite
jgwhite / SketchSystems.spec
Created December 11, 2019 17:37
Required form field
Required form field
Untouched
focus -> Untouched
blur -> Untouched
enter valid input -> Valid
enter invalid input -> Invalid
submit form -> Invalid
Invalid
@jgwhite
jgwhite / app\helpers\assert.js
Last active December 4, 2019 14:23
Ember {{assert}} helper
import { helper } from '@ember/component/helper';
import { assert } from '@ember/debug';
/**
* Verify that a certain expectation is met, or throw a exception
* otherwise.
*
* Delegates directly to `assert` from `@ember/debug`.
*
* @param {string} description - Describes the expectation. This will
@jgwhite
jgwhite / SketchSystems.spec
Created September 18, 2019 09:52
A login flow for NASA in the 1970s
A login flow for NASA in the 1970s
Sign in
Submit correct email and password -> 2FA
Submit correct badge number and password -> 2FA
Submit incorrect email -> Sign in error
Submit incorrect badge number -> Sign in error
Submit incorrect password -> Sign in error
Click forgot -> Forgot
Sign in error
Submit correct email and password -> 2FA
@jgwhite
jgwhite / controllers.application.js
Last active June 18, 2019 08:18
readOnly('foos.@each.bars')
import Ember from 'ember';
import { readOnly } from '@ember/object/computed';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
foos: [{
bars: ['a', 'b']
}, {