Skip to content

Instantly share code, notes, and snippets.

View rthor's full-sized avatar

Ragnar Þór Valgeirsson rthor

View GitHub Profile
import { createMachine, actions, assign } from "xstate";
const { raise } = actions;
const stubbornMachine = createMachine({
id: "number",
context: {
numb: 0,
},
on: {
"number.reset": {
@rthor
rthor / machine.js
Last active September 23, 2019 12:47
Generated by XState Viz: https://xstate.js.org/viz
const activeTripMachine = Machine(
{
id: 'activeTrip',
initial: 'inactive',
context: {
trip: null,
},
states: {
inactive: {
invoke: {
@rthor
rthor / machine.js
Last active September 24, 2019 10:32
Generated by XState Viz: https://xstate.js.org/viz
const activeTripMachine = Machine(
{
id: 'activeTrip',
initial: 'inactive',
context: {
trip: null,
errorCode: null,
},
states: {
@rthor
rthor / machine.js
Created September 21, 2019 23:42
Generated by XState Viz: https://xstate.js.org/viz
const activeTripMachine = Machine({
id: 'activeTrip',
initial: 'init',
context: {
trip: null,
lastTrip: null,
pollInterval: 15000,
},
states: {
init: {
@rthor
rthor / machine.js
Created September 21, 2019 13:52
Generated by XState Viz: https://xstate.js.org/viz
const activeTripMachine = Machine({
id: 'activeTrip',
initial: 'init',
context: {
tripId: null,
pollInterval: 30000,
},
states: {
init: {
exit: ['hasActiveTrip'],
@rthor
rthor / README.md
Last active November 15, 2018 13:15
git hook for adding a jira ticket number to relevant commits.

git hook for adding a jira ticket number to relevant commits.

Note: It expects relevant branches to have this naming pattern: PREFIX/USER_NAME/JIRA-TICKET

Steps to include:

> cd PROJECT_ROOT/.git/hooks/

Keybase proof

I hereby claim:

  • I am rthor on github.
  • I am rthor (https://keybase.io/rthor) on keybase.
  • I have a public key ASD-n4k766qUgJmQsMzXa7lsBS-CzgFxzaf85R6b3a5MmAo

To claim this, I am signing this object:

#!/bin/bash
echo "Removing dependencies...";
rm -rf $1/**/node_modules;
echo "Ziping...";
zip -r -q $1.zip $1;
echo "Removing original...";
rm -rf $1;
27/12/14 14:18:35,492 Chroma[44698]: Unable to simultaneously satisfy constraints:
(
"<NSLayoutConstraint:0x6080002809b0 V:[NSImageView:0x60800016e7c0]-(13)-| (Names: CRAddRowView:0x6080001ff200, '|':CRAddRowView:0x6080001ff200 )>",
"<NSLayoutConstraint:0x608000280a00 CRAddRowView.centerY == NSImageView:0x60800016e7c0.centerY (Names: CRAddRowView:0x6080001ff200 )>",
"<NSLayoutConstraint:0x608000280a50 V:|-(12)-[NSImageView:0x60800016e7c0] (Names: CRAddRowView:0x6080001ff200, '|':CRAddRowView:0x6080001ff200 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x608000280a00 CRAddRowView.centerY == NSImageView:0x60800016e7c0.centerY (Names: CRAddRowView:0x6080001ff200 )>