Skip to content

Instantly share code, notes, and snippets.

@gkiely
gkiely / machine.js
Created May 21, 2022 00:01
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@gkiely
gkiely / machine.js
Last active May 17, 2022 02:13
Generated by XState Viz: https://xstate.js.org/viz
const doMatch = () => '';
const isValidInput = () => true;
const calculator = Machine({
id: 'calculator',
initial: 'idle',
context: {
input: '',
result: '',
buttonText: 3,
@gkiely
gkiely / SassMeister-input.scss
Created August 26, 2015 01:06
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
.test {
.flex & &__yo{
background: red;
}
@gkiely
gkiely / Swap Elements
Last active December 18, 2015 21:29
Swap elements
function swapElements(elm1, elm2) {
var parent1, next1,
parent2, next2;
parent1 = elm1.parentNode;
next1 = elm1.nextSibling;
parent2 = elm2.parentNode;
next2 = elm2.nextSibling;
parent1.insertBefore(elm2, next1);