Skip to content

Instantly share code, notes, and snippets.

View stephenkoo's full-sized avatar

Stephen Koo stephenkoo

  • Melbourne, Australia
View GitHub Profile
@stephenkoo
stephenkoo / machine.js
Last active April 17, 2020 04:39
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@stephenkoo
stephenkoo / machine.js
Last active April 17, 2020 04:40
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@stephenkoo
stephenkoo / machine.js
Last active April 17, 2020 04:45
Generated by XState Viz: https://xstate.js.org/viz
const fetchCuteAnimals = () => {
// return fetch('https://www.reddit.com/r/aww.json')
// .then(res => res.json())
// .then(data => data.data.children.map(child => child.data))
return Promise.reject()
}
// A PROMISE AS A STATE MACHINE
const cuteAnimalMachine = Machine({
id: 'cuteAnimals',
@stephenkoo
stephenkoo / gpg-setup.sh
Created July 10, 2019 00:14
Get set up with Signed Commits on macOS
#!/bin/bash
INFO='\033[1;32m'
NC='\033[0m'
GNUPG_DIR="$HOME/.gnupg"
function info() {
echo -e "${INFO}$1${NC}"
}