Skip to content

Instantly share code, notes, and snippets.

View darrenbutcher's full-sized avatar

Darren Butcher darrenbutcher

  • Hack by Design
  • Toronto, Canada/St. Maarten
View GitHub Profile
@darrenbutcher
darrenbutcher / machine.js
Created December 17, 2020 17:46
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
"id": "2. BYO",
"initial": "Black Panel",
"states": {
"Black Panel": {
"on": {
"EXPAND": "Black Panel Expanded",
"OPEN": "Pricing Modal"
}
},
@darrenbutcher
darrenbutcher / machine.js
Last active December 14, 2020 18:02
Generated by XState Viz: https://xstate.js.org/viz
const createTodo = (value) => {
return {
id: value,
name: value,
completed: false
}
}
const todosMachine = Machine({
id: 'todos',
@darrenbutcher
darrenbutcher / machine.js
Created December 14, 2020 16:17
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@darrenbutcher
darrenbutcher / machine.js
Last active December 14, 2020 16:16
Generated by XState Viz: https://xstate.js.org/viz
const lampMachine = Machine({
id: 'lamp',
initial: 'unplugged',
states: {
unplugged: {
on: {
PLUG_IN: 'plugged.hist',
BREAK: '#broken'
}
},
@darrenbutcher
darrenbutcher / 0_reuse_code.js
Created August 11, 2014 04:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@darrenbutcher
darrenbutcher / hack.sh
Created May 22, 2012 16:03 — forked from DAddYE/hack.sh
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions: