avanier's banner

macintosh

people walking towards an Apple store
0/10, they didn’t have any fruit

I use a Mac for work. I will always prefer my ThinkPad.

tools
ACLIJira
asdfruntime version manager
VS Code*IDE
Colimacontainer runtime
Dozerhides stuff in the menu bar
fzffuzzy finder
ghGitHub CLI
gumfor glamorous shell scripts
Homebrewpackage manager
iTermterminal
jqJSON processor
Obsidianpersonal knowledge management
PosticoPostgreSQL client
Postgres.app
ShellCheckshell script analysis
starshipshell prompt
VS Code extensions
Catppuccintheme and icons
CredoElixir linter
ElixirLSElixir language support and debugger
GitLensgit supercharger
NPMmanage dependencies
shell-formatshell script formatter
Vitesttesting framework

shortcuts

I can’t technically share the Shortcuts I have set up due to ridiculous work policies regarding intellectual property and yada-yada, but I can tell you some of the ones I use.

morn
runs every morning and sets me up for the work day (turns the Wi-Fi on, opens Slack and IDE, etc.)
sol
checks the UV index in the area and lets me know if it's safe to go outside
join
opens the Meet link of the next calendar event
qrl
generates a QR code from the clipboard
eve
runs when I go for lunch or clock out of work (sets DND, turns the Wi-Fi off for good measure, then sleeps)

You can set up cron jobs to run Shorcuts:

# work-life balance
0 9,13 * * * shortcuts run morn
0 12,17 * * * shortcuts run eve
flight mode at . no exceptions except when I'm feeling generous/helpful.

applescript

AppleScript is a scripting language.

Send a system notification with sound (sound files in /System/Library/Sounds or ~/Library/Sounds)

osascript -e 'display notification "take a break" sound name "Glass"'

Show a popup dialog. I currently use this to remind me to take breaks every 20 minutes throughout the work day

*/20 9-17 * * 1-5 osascript -e 'display dialog "take a break"'

When I’m testing things locally, i.e. web apps in incognito, the first thing I usually do is open DevTools. Not sure why but launching Chrome with --auto-open-devtools-for-tabs doesn’t actually open DevTools, so here’s an AppleScript workaround:

URL="http://localhost:8715" # or whatever

osascript <<EOF
tell application "Google Chrome"
  do shell script "open -na 'Google Chrome' --args --incognito '$URL'"
  delay 1
  tell application "System Events"
    keystroke "i" using {command down, option down}
  end tell
end tell
EOF

Mute/unmute the microphone. Company™ IT may have sleazy ways around this, so every now and then, I directly grace the microphone with a proximate and prolonged whistle, just in case.

osascript -e "set volume input volume 0"
osascript -e "set volume input volume 50"

grimoire

first logo of Apple designed by Ronald Wayne, featuring Sir Isaac Newton sitting under the apple tree where he supposedly discovered gravity, by an apple falling on his head.

Copy and paste stuff via Terminal

echo 'meow' | pbcopy
pbpaste

GPG issues? Usually occurs after package update

gpgconf --kill gpg-agent

Make Mac sleep

pmset sleepnow

Prevent Mac from sleeping

caffeinate
caffeinate -u -t 3600 # stay awake for an hour

get battery cycle count

system profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'

xcode woes

xcode-select --install
xcode-select --reset

Remind yourself to leave. This will constantly prompt your terminal with a Time to leave! message every minute. To disable it, you have to log off (or use kill).

leave 1700 # leave at 17:00
leave +0130 # leave in 1 hour and 30 minutes

resources

I Hate Macintosh