Skip to content

Instantly share code, notes, and snippets.

@skratchdot
skratchdot / iterm2.md
Created November 14, 2023 11:56 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@skratchdot
skratchdot / list-word-lengths.sh
Created September 15, 2022 12:07
list word length counts from 1 to 24
#!/usr/bin/env bash
for i in {1..24}
do
cat /usr/share/dict/words | grep -E "^.{$i}$" | wc -l
done
: '
OUTPUT:
@skratchdot
skratchdot / fun-with-words-and-bash.md
Last active February 26, 2022 23:42
fun with words and bash

fun with words and bash

number of words 8 characters or less

cat /usr/share/dict/words | awk 'length <= 8' | wc -l

display a random 5 character word

@skratchdot
skratchdot / hexdump.md
Last active June 17, 2023 02:20
hexdump tools for pretty printing strings/files as hex dumps
@skratchdot
skratchdot / midi-id-number.md
Last active June 21, 2021 10:52
generate non-commercial midi id number

The Complete MIDI 1.0 Detailed Specification states:

Special ID 7D is reserved for non-commercial use (e.g. schools, research, etc.)
and is not to be used on any product released to the public.

Here's a little bash one-liner to generate a somewhat unique 4-byte midi id:

@skratchdot
skratchdot / _README.md
Last active April 13, 2021 23:10
web-audio-api pr: standardizing h3/h4/h4 interface and dictionary markup
@skratchdot
skratchdot / README.md
Last active July 26, 2023 04:38
ngrok bookmarklet - add qr codes to the http://127.0.0.1:4040/status page

ngrok qr codes

description

since the free version of ngrok creates random urls each time you run it, it gets time consuming typing the url on your phone. this bookmarklet lets you point your phone at the "status" page of ngrok's "web interface".

instructions

#!/usr/bin/env bash
# create 1 second 440Hz sine wave
sox -n -c 1 -r 44100 sine.wav synth 1 sine 440
# create 1 second of silence
sox -n -c 1 -r 44100 silence.wav trim 0 1
# create 1 second 440Hz sine wave followed by 1 second of silence
sox -V sine.wav silence.wav output.wav
@skratchdot
skratchdot / gist:cb4d4cada553a28128a2eb58e45bc63f
Created June 2, 2020 16:32
pip install - some python audio/video related libs i've installed to get various tools working
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
python3 -m pip install --upgrade librosa
python3 -m pip install --upgrade pydub
python3 -m pip install --upgrade moviepy
python3 -m pip install --upgrade numpy scipy matplotlib ipython jupyter pandas sympy nose
python3 -m pip install --upgrade pysndfx
python3 -m pip install --upgrade pyopencl
python3 -m pip install --upgrade scikit-learn
python3 -m pip install --upgrade MulticoreTSNE
@skratchdot
skratchdot / say_fns.sh
Created October 11, 2019 14:48
some helper functions for the OSX say command (random words, random voices, etc)
## say with a random voice
say_rand () {
say -v $(say -v ? | awk '{print $1}' | shuf -n1) "$@"
}
## say with a random english voice
say_rand_en () {
say -v $(say -v ? | grep en_ | awk '{print $1}' | shuf -n1) "$@"
}