Skip to content

Instantly share code, notes, and snippets.

@xomaczar
xomaczar / controllers.application\.js
Last active October 4, 2021 15:59
Template-only tracked
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@xomaczar
xomaczar / machine.js
Last active May 27, 2021 22:23
Generated by XState Viz: https://xstate.js.org/viz
const jwtTokenStates = {
new: {
onEntry: [
'start activity service',
't = jwt.exp - jwt.iat - cfg.delta',
'setInterval(t, VERIFY)'
],
onExit: [
'cancel interval',
'stop activity service'
@xomaczar
xomaczar / machine.js
Created May 27, 2021 20:24
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@xomaczar
xomaczar / machine.js
Created September 26, 2020 04:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@xomaczar
xomaczar / .eslintrc.js
Created September 25, 2019 18:34 — forked from alexdiliberto/.eslintrc.js
Integrate Prettier with Ember
/*
'plugin:prettier/recommended' does the following:
extends: ['prettier'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error'
}
*/
module.exports = {
@xomaczar
xomaczar / .eslintrc.js
Created September 25, 2019 18:34 — forked from alexdiliberto/.eslintrc.js
Integrate Prettier with Ember
/*
'plugin:prettier/recommended' does the following:
extends: ['prettier'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error'
}
*/
module.exports = {
@xomaczar
xomaczar / controllers.application.js
Last active September 11, 2019 14:02
cancel-type select
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
serializedReasonCode: undefined,
actions: {
reasonCodeChanged({ target }) {
this.model.set('cancelType', target.value);
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
isGTSUser: Ember.computed('userType', function() {
return this.get('user.userType') === 'gts_user'
}),
actions: {
import Ember from 'ember';
import EmberArray from 'ember/array';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this.super(...arguments);
this.simpleTypeSetA = EmberArray();
},
actions: {
@xomaczar
xomaczar / controllers.application.js
Created August 16, 2017 02:22
Filter with observable helpers
import Ember from 'ember';
const { Controller, A: emberArray } = Ember;
export default Controller.extend({
appName: 'Ember Twiddle',
actions: {
selectState(stateID) {
this.set('matchedFilters', [stateID]);
this.get('matchedFiltersStable').pushObject(stateID);