Skip to content

Instantly share code, notes, and snippets.

View chukinas's full-sized avatar

Jonathan Chukinas chukinas

  • Comoto
  • West Chester, PA, USA
View GitHub Profile

fdr

  • Must: Pycharm refactoring must work (this, plus PEP XXX's recommendation not to use relative imports, means I have to use absolute imports.
  • Which: src or no source?
  • Which: Packaging utilities? (setup tools + twine, flit, xxxx?)
  • Must: Pytest tests must work
  • How: Developer environment (ie I don't want to have to install before running my code). Tox?
  • How: imports? relative? absolute? import the installed package?
@chukinas
chukinas / machine.js
Created April 22, 2020 02:54
Generated by XState Viz: https://xstate.js.org/viz
const pedestrianStates = {
key: 'peds',
initial: 'walk',
states: {
walk: {
on: {
PED_COUNTDOWN: 'wait'
}
},
@chukinas
chukinas / machine.js
Last active April 22, 2020 22:42
Generated by XState Viz: https://xstate.js.org/viz
const clueTurnMachine = {
id: 'clue-turn-machine',
initial: 'begin_turn',
states: {
begin_turn: {
on: {NEXT: 'choosing_clue'},
after: {5000: 'showing_target_word'}
},
showing_target_word: {
on: {NEXT: 'choosing_clue'},
@chukinas
chukinas / machine.js
Last active May 7, 2020 21:40
Generated by XState Viz: https://xstate.js.org/viz
const hiddenClues = {
id: 'hiddenClues',
initial: 'thinking',
states: {
thinking: {
on: {
SUBMIT_CLUE: {
target: 'waiting',
cond: 'isSelfEvent',
}
@chukinas
chukinas / machine.js
Last active May 8, 2020 11:52
Generated by XState Viz: https://xstate.js.org/viz
// https://xstate.js.org/viz/?gist=360718e57b8550e05dc5554b953de3af
const local = {
on: {
CANCEL: '#deleted',
SAVE: {
target: '#active',
cond: 'isPartiallyValidated',
},
SUBMIT: {
@chukinas
chukinas / machine.js
Last active May 7, 2020 20:06
Generated by XState Viz: https://xstate.js.org/viz
const buttonA = {
id: 'buttonA',
initial: 'hist',
states: {
off: {
on: {
TOGGLEA: 'on'
}
const buttonFactory = id => {
const toggleName = `TOGGLE${id}`
return {
id: `button${id}`,
initial: 'hist',
states: {
off: {
on: {
[toggleName]: 'on'
}
@chukinas
chukinas / machine.js
Last active May 7, 2020 20:30
Generated by XState Viz: https://xstate.js.org/viz
const buttonFactory = id => {
const toggleName = `TOGGLE${id}`
return {
id: `button${id}`,
initial: 'hist',
states: {
off: {
on: {
[toggleName]: 'on'
}
const buttonFactory = id => {
const toggleName = `TOGGLE${id}`
return {
id: `button${id}`,
initial: 'hist',
states: {
off: {
on: {
[toggleName]: 'on'
}
@chukinas
chukinas / machine.js
Last active May 7, 2020 21:46
Generated by XState Viz: https://xstate.js.org/viz
const guards = {
isSelf: ()=>false,
}
const eventConflicts = Machine({
id: 'conflicts',
initial: 'first',
on: {
SUBMIT: 'third',
},