Skip to content

Instantly share code, notes, and snippets.

View msell's full-sized avatar

Matt Sell msell

View GitHub Profile
@msell
msell / KeyOfA.md
Last active March 4, 2022 14:45
Diatonic Chord Progressions in A and A minor

Key of A

A Major Scale

1 2 3 4 5 6 7 Octave
A B C# D E F# G# A

Diatonic chord progression - A Major

@msell
msell / machine.js
Created June 2, 2021 04:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@msell
msell / machine.js
Last active June 2, 2021 05:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@msell
msell / machine.js
Last active May 28, 2021 01:16
Generated by XState Viz: https://xstate.js.org/viz
const noMechanicsAssigned = (context, event) => {
return context.mechanicsAssigned < 1
}
const caseMachine = Machine({
id: 'case',
initial: 'open',
context: {
Route Duration Miles Things to do Notes Nights
Fairview to Little Rock 4h 45m 313 things with kids We dont need to spend the night here, we could spend the day here then drive to Memphis at night to stay. 0
Little Rock to Memphis 2h 10m 137 tour, BBQ, Riverboat Cruise Tour looks really good, riverboat could be good too 1
Memphis to Nashville 3h 15m 212 1
Nashville to Atlanta 3h 46m This would be an alternate route instead of going to Birmingham 1
Atlanta to Destin FL 5h 11m 315 2
Destin to New Orleans 3h 57m 252 2
New Orleans to Shreveport 5h 327
@msell
msell / react-state-management.md
Last active March 13, 2021 05:55
State Management

React development has always had a bit of a choose your own adventure experience. By that I mean there are a LOT of choices to make in any react app. Other frameworks are much more prescriptive in how you build applications. You won't get very far down your adventure before you must make some choices in how you handle data and state within your application. React components can have state using setState in a class component or useState in a function component. That along with context is really all React gives you out of the box. Over the years there have been countless state management solutions that have risen and fallen in popularity. Have a look at React State Museum to see about 20 of the most popular approaches over the years. There was a time where it looked like Redux was going to be the clear winner and for maybe a couple of years it did seem like every enterprise react app was built with redux. It's sort of fallen out of favor in recent years. Over the

@msell
msell / machine.js
Created February 12, 2021 18:28
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'aog',
initial: 'open',
context: {
},
states: {
open: {
initial: 'initial',
on: {
STALL: 'stalled',
@msell
msell / machine.js
Last active November 13, 2020 19:32
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Jigsaw puzzle</title>
<script type="text/javascript">
function save(filename, data)
{
var blob = new Blob([data], {type: "text/csv"});
@msell
msell / machine.js
Created June 15, 2020 15:41
Generated by XState Viz: https://xstate.js.org/viz
const setSpeechNodeContext = (lang, text) =>
assign({
speechText: text,
speechLanguage: lang,
});
const setListenNodeContext = (lang, conditions) =>
assign({
listenConditions: conditions,