Skip to content

Instantly share code, notes, and snippets.

View parties's full-sized avatar

Eric Ogden parties

View GitHub Profile
@parties
parties / yarn-workspaces-lerna-notes.md
Last active November 12, 2021 18:09
Yarn Workspaces / Lerna Notes

Yarn Workspace Commands

Run a command in a single workspace

yarn workspace <name from package.json> <command>

Example:

@parties
parties / machine.js
Last active October 4, 2021 23:40
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@parties
parties / toggle_bluetooth.scpt
Last active August 23, 2021 18:36
Quicksilver + blueutil script for easily toggling bluetooth power
-- Requirements:
-- blueutil v2.9.0+ (brew install blueutil); may work with earlier versions, haven't tested
-- save this under ~/Library/Scripts and refresh your user scripts in Quicksilver for this to appear
-- you can create a trigger to run this script on a keyboard shortcut, such as: ⌘⌥^ + B
-- save local path to blueutil executable
set blueutil to "/usr/local/bin/blueutil"
-- get current power status and save it to variable
@parties
parties / docker-cheat-sheet.sh
Created August 3, 2021 20:03
Docker Cheat Sheet
# Work in progress, just collecting all the useful docker shortcuts I use
# remove all containers, including volumes
docker rm -vf $(docker ps -a -q)
# delete all images
docker rmi -f $(docker images -a -q)
@parties
parties / machine.js
Last active March 10, 2021 05:40
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
Fanar
Planning*
Plan
calculate -> Plan
reassign requirement to vessel -> Reassignment
promote -> Promote
Reassignment
reassign requirement to vessel -> Plan
unassign requirement from vessel -> Plan
Promote
@parties
parties / machine.js
Last active February 2, 2021 05:52
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@parties
parties / machine.js
Last active January 25, 2021 22:56
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'Fleet Page API',
initial: 'idle',
context: {
dog: null,
schedule: null,
},
states: {
idle: {
on: {
export interface PortAccess {
portaccessname: string;
}
export interface PortGeocode {
portcoordinates: string;
portpolygon: string;
fairwaycoordinates: string;
boardingcoordinates: string;
notes: string;
@parties
parties / use-force-update.js
Created March 16, 2020 07:36
useForceUpdate hook
function useForceUpdate () {
const [value, setValue] = React.useState(0) // integer state
return () => setValue(value => ++value) // update the state to force render
}