Shell Tricks: Pretty Printing the name of your program
You might need to print or use the name of your program itself — what you
would see if you ran basename my-script.sh
. tl;dr: use ${0##*/}
.
Shell Tricks: Detecting if your script is being piped
If you need to check if a shell script is being piped to another program (i.e.
bash yourscript.sh | less
) you can use test -t 1
and friends.
A solution for git repos and iCloud?
If you’re tried keeping a git repo in an iCloud (or Dropbox) folder before,
you know it works fine — until it doesn’t. Something inevitably happens
one day while one of your devices is syncing, and your repo is corrupted, such
that a bunch of your files look like they’ve been changed. A workaround I’ve
been playing with is custom $GIT_DIR
set via direnv. Here’s how I set
it up.
You can’t parse HTML with regex
This now infamous post on Stack Overflow — You can’t parse HTML with regex — is one of my favorites. I think every dev has tried it at least three times: first time you do something simple and it Just Works™; second time you try something advanced and manage to figure out most of the edge cases so it Mostly Works™; final time is such a nightmare you wish you’d chosen to build Things Out of Wood™ instead of code.
Fun with jq and Tautulli
Responsive CSS Gallery
Searching for image gallery templates, I came across this one that looks light-weight and decent enough.
Dev Shower Thought: Webmaster
Dev Shower Thought: Webmaster on a resume in the 90s looked pretty sweet; in 2022 it’s a red flag saying “I don’t really know what I’m talking about.”
37
I am 37 today. I’ve spent the last week or so hacking on this blog and reviewing old content since I turned 21. I thought I’d wrap up my nostalgia trip with a check in on what life is like in 2022.
The Web Is Fucked
A few weeks ago I came across The Web Is Fucked and it’s really stuck with me. I miss Web 1.0.