Skip to content

Instantly share code, notes, and snippets.

View parties's full-sized avatar

Eric Ogden parties

View GitHub Profile
@parties
parties / renameReactJsToJsx.sh
Last active April 23, 2024 12:06
rename all *.js files containing React markup to *.jsx
# finds all *.js files that have either `</` or `/>` tags in them and renames them to *.jsx
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "</|/>" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \;
@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)

bash notes

ffmpeg

  • timelapse video
    # setpts multiplier: smaller is faster
    ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" -an output.mp4
  • compress
@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: {