Skip to content

Instantly share code, notes, and snippets.

@camwest
camwest / machine.js
Last active August 20, 2020 21:15
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
Pyramid
Core App
investing -> Investing
data vault -> Data Vault
rewards -> Rewards
profile -> Profile
Investing
Data Vault
R1
iOS App
Logged Out
create account -> Create Account
login -> Logged In
sign in with apple -> Accept Terms
Create Account
enter credentials -> Validate Email
Validate Email
enter correct token -> Accept Terms
@camwest
camwest / machine.js
Last active August 1, 2019 17:58
Generated by XState Viz: https://xstate.js.org/viz
// See https://xstate.js.org/viz/?gist=759a3ee0b7d85087b18be566a1f40224 for a visualization.
// It may need to be updated. To do so just copy & paste and remove the `export` keywords.
const States = {
START_EMAIL_AUTH: "START_EMAIL_AUTH",
LOGIN_OR_CREATE: "LOGIN_OR_CREATE",
LOGIN: "LOGIN",
LOGGED_OUT: "LOGGED_OUT",
CREATE_ACCOUNT: "CREATE_ACCOUNT",
ACCEPT_TERMS: "ACCEPT_TERMS",
@camwest
camwest / SketchSystems.spec
Last active September 17, 2018 19:50
Marketing Site2
Marketing Site2
Educating
download app -> Downloading
Downloading
download app -> App
App
Verify Phone Number
verified -> Verify Email
Verify Email
verified -> Census Survey
@camwest
camwest / SketchSystems.spec
Last active September 17, 2018 19:49
Marketing Site
Marketing Site
Educating
download app -> Downloading
Downloading
download app -> App
App
Verify Phone Number
verified -> Verify Email
Verify Email
verified -> On Wait List
@camwest
camwest / SketchSystems.spec
Last active June 21, 2018 00:41
Pre Authenticate
Pre Authenticate
oxygen logged in? -> Propose Access
acad-web logged in? -> Logged In
not logged in? -> Authenticate
Propose Access
continue -> Logged In
switch account -> Logging Out
Logging Out
logged out -> Authenticate
<Canvas
ref={this.assignCanvas}
isDeleteEnabled={this.props.isDeleteEnabled}
isFabricModalActive={this.props.isMTextEditing}
visible={!this.props.documentOpening}
selectedObjectTypesCount={this.props.selectedObjectTypesCount}
onCanvasLoad={this.props.canvasLoad}
onCanvasLoadSuccess={this.props.canvasLoadSuccess}
onCanvasSnapOverrides={this.props.canvasSnapOverrides}
onCanvasLoadFail={this.props.canvasLoadFail}
Login
Login Cached?
cached? -> Enter Credentials
not cached? -> Login Downloading
Login Downloading
downloaded -> Enter Credentials
Enter Credentials
login success -> File Manager
@camwest
camwest / permutations.js
Created February 14, 2018 22:23 — forked from wassname/permutations.js
Combinatorics permutatons and product in javascript using lodash.js (like python's itertools)
/**
* Lodash mixins for combinatorics
* Inspired by python itertools: https://docs.python.org/2.7/library/itertools.html
*
* Usage:
* permutations([0,1,2],2) // [[0,1],[0,2],[1,0],[1,2],[2,0],[2,1]]
* combinations([0,1,2],2) // [[0,1],[0,2],[1,2]]
* combinations_with_replacement([0,1,2],2)// [[0,0],[0,1],[0,2],[1,1],[1,2],[2,2]]
* product([0,1,2],[0,1,2]) // [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2]]
*