Skip to content

Instantly share code, notes, and snippets.

View tamebadger's full-sized avatar

Rupert Klopper tamebadger

  • Grand Cayman, Cayman Islands
  • 10:11 (UTC -12:00)
View GitHub Profile
@tamebadger
tamebadger / keybase.md
Created July 15, 2024 18:27
keybase proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tamebadger
tamebadger / machine.js
Created January 29, 2020 16:23
Generated by XState Viz: https://xstate.js.org/viz
function isDifferentFlight(flight1, flight2) {
let valid =
(!flight1 && flight2) ||
(
flight1 && flight2 &&
(
flight1.state !== flight2.state ||
flight1.flightNumber !== flight2.flightNumber ||
flight1.takeoffDateTime !== flight2.takeoffDateTime ||
flight1.originIATA !== flight2.originIATA ||
@tamebadger
tamebadger / machine.js
Last active January 29, 2020 09:55
Generated by XState Viz: https://xstate.js.org/viz
const pedestrianStates = {
initial: 'walk',
states: {
walk: {
on: {
PED_COUNTDOWN: 'wait'
}
},
wait: {
on: {
@tamebadger
tamebadger / machine.js
Last active October 31, 2019 09:38
Generated by XState Viz: https://xstate.js.org/viz
const parentMachine = Machine({
id: 'your_id_here',
initial: 'pending',
states: {
pending: {
on: { CHANGE_EVENT: 'process' }
},
process: {
type: 'parallel',
states: {
@tamebadger
tamebadger / machine.js
Created October 25, 2019 10:43
Generated by XState Viz: https://xstate.js.org/viz
const isUndefined = (x) => typeof x === 'undefined';
const flightOpen = ({ flight }) => !isUndefined(flight);
const flightClosed = ({ flight }) => !!isUndefined(flight);
const flight = undefined;
const fetchMachine = Machine({
id: 'flight',
context: { flight, error: undefined },
@tamebadger
tamebadger / machine.js
Created October 23, 2019 10:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
import Ember from 'ember';
const { computed: { alias }, observer } = Ember
export default Ember.Component.extend({
params: Ember.inject.service('task-pager')
})
@tamebadger
tamebadger / components.display-qp.js
Created May 17, 2016 10:44
Query Param Component
import Ember from 'ember';
const { computed: { alias }, observer } = Ember
export default Ember.Component.extend({
routing: Ember.inject.service('-routing'),
params: alias('routing.router.currentState.routerJsState.fullQueryParams')
})
import Ember from 'ember';
export default Ember.Controller.extend({
})