Skip to content

Instantly share code, notes, and snippets.

View mkallies's full-sized avatar
🎯
Focusing

Michael Kallies mkallies

🎯
Focusing
View GitHub Profile
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
'@apollo/client':
specifier: 3.8.1
version: 3.8.1(graphql-ws@5.14.0)(graphql@16.8.0)(react-dom@18.2.0)(react@18.2.0)
@mkallies
mkallies / audience.md
Last active April 22, 2021 15:03
Audience Fun
  • One past action needs to satisfy a rule. Once it satisfies a rule it cannot satisfy another.
  • Our current implementation doesn’t care about order and can satisfy more than 1 rule
  1. Iterate through each UserAction and add to map of lists for each rule
  2. Sort by length, smallest first
  3. Create MapSet
  4. Grab first element from first list
  5. Grab first element in next list that isn’t the first (MapSet.member?)
  6. Using already collected list, pick next element that isn’t in the created list
@mkallies
mkallies / machine.js
Created March 27, 2020 11:31
Generated by XState Viz: https://xstate.js.org/viz
const events = {
SUBMIT: "submit",
LOG_OUT: "logout"
}
const authMachine = Machine(
{
id: "login",
initial: "init",
context: {
@mkallies
mkallies / machine.js
Last active March 27, 2020 11:29
Generated by XState Viz: https://xstate.js.org/viz
const events = {
POST: "post",
REFETCH: "refetch",
DELETE: "delete",
MORE_INFO: "more-info",
CLOSE: "close"
}
const messageMachine = Machine(
{
@mkallies
mkallies / machine.js
Created February 12, 2020 17:34
Generated by XState Viz: https://xstate.js.org/viz
const authStates = {
login: 'login',
signUp: 'signup',
forgotPassword: 'forgotPassword',
loggedIn: 'loggedIn',
loggingOut: 'loggingOut',
twoFA: 'twoFA',
}
const events = {
@mkallies
mkallies / machine.js
Created December 17, 2019 18:53
Generated by XState Viz: https://xstate.js.org/viz
const authStates = {
login: "login",
signUp: "signup",
forgotPassword: "forgotPassword",
loggedIn: "loggedIn",
loggingOut: "loggingOut",
twoFA: "twoFA"
};
const authOpts = {
@mkallies
mkallies / machine.js
Created December 11, 2019 18:39
Generated by XState Viz: https://xstate.js.org/viz
// import { Machine, assign } from 'xstate'
// import { post } from '../../network/request'
// import { userEndpoints } from '../../configs/api'
// import LS, { storageKeys } from '../../utilities/local-storage'
// import { fetchRecoveryCode } from '../security-settings/two-factor/two-factor.machine'
// Services
// const createAccount = (ctx, evt) => {
// return post(userEndpoints.create, evt.payload)
// }
@mkallies
mkallies / machine.js
Last active November 21, 2019 20:10
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@mkallies
mkallies / machine.js
Created November 17, 2019 22:14
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions