Skip to content

Instantly share code, notes, and snippets.

View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
const addressMachine = Machine(
{
id: "address",
initial: "init",
states: {
init: {
on: {
"": [
{ target: "edit", cond: "alreadyHasValues" },
{ target: "search" },
View machine.js
const machine = Machine(
{
id: "wizard",
initial: "nameEntry",
context: { values: {} },
meta: { version: 1 },
states: {
nameEntry: {
on: {
View machine.js
const machine = Machine(
{
id: "wizard",
initial: "nameEntry",
context: { values: {} },
meta: { version: 2 },
states: {
nameEntry: {
on: {
View machine.js
const machine = Machine(
{
id: "wizard",
initial: "nameEntry",
context: { values: {} },
states: {
nameEntry: {
on: {
NEXT: {
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@codeincontext
codeincontext / random_emoji.sh
Created Aug 29, 2016
Print a random star/success emoji (for my prompt)
View random_emoji.sh
#!/bin/bash
emojis=( ✨ ⚡️ 💫 🔑 )
num_emojis=${#emojis[*]}
echo "${emojis[$((RANDOM%num_emojis))]}"
View upload-kindle-image.js
function renderSVG() {
services.fetchAll()
.done(function(results) {
const data = {};
results.forEach(r => data[r.name] = r);
const lastSeenDates = results.map(r => r.lastSeenDate);
data.lastSeenDate = Math.max.apply(Math, lastSeenDates);
// console.log(data)
View kindle-readme.md

Kindle Son Status Board

An e-ink status board so my mum knows what's up

Stack

Node: