Skip to content

Instantly share code, notes, and snippets.

View mwarger's full-sized avatar
😎
coooode

Mat Warger mwarger

😎
coooode
View GitHub Profile
@mwarger
mwarger / machine.js
Created July 14, 2021 17:03
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'toggle',
initial: 'inactive',
states: {
inactive: { on: { TOGGLE: 'active' } },
active: { on: { TOGGLE: 'inactive' } }
}
})
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
@mwarger
mwarger / machine.js
Created March 29, 2020 19:12
Generated by XState Viz: https://xstate.js.org/viz
const toggleMachine = Machine({
id: 'toggle',
initial: 'inactive',
states: {
inactive: { on: { TOGGLE: 'active' } },
active: { on: { TOGGLE: 'inactive' } }
}
});
@mwarger
mwarger / machine.js
Last active March 8, 2020 19:00
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine(
{
id: "fetch",
initial: "idle",
context: {
url: {},
data: null,
error: null,
retries: 0,
maxRetries: 3
@mwarger
mwarger / machine.js
Created March 1, 2020 21:53
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
on: {
FETCH: 'loading'
@mwarger
mwarger / machine.js
Created February 20, 2020 02:50
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@mwarger
mwarger / machine.js
Created February 20, 2020 02:43
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@mwarger
mwarger / machine.js
Created February 20, 2020 02:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@mwarger
mwarger / react-ts.code-snippets
Created August 7, 2019 17:17
ts code snippets for react, ts, theme-ui
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
@mwarger
mwarger / flutter emulator setup
Created July 12, 2019 18:16
how to correctly setup emulator for use with vs code flutter plugin
flutter emulators --create --name Pixel-test
flutter emulators --launch Pixel-test