I’ve worked on websites for several years, both professionally and for side projects. One day, I reflected on the fact that all of my web development education had come from actually making websites. In most cases, I’d have a specific problem, Google how to solve it, and learn something new in the process.
You can do the same thing in TypeScript, but there is an important caveat if your
tsconfig.json has a compilation target of ES3 or ES5. In that case,
instanceof doesn't work, which breaks any logic that is based on whether or not an error is a case of the custom error.
Trying to concatenate other types, like nil or a table, will result in an error.
Strings in Lua are immutable, so the concatenation result (
message in this example) is a brand new string.
If you need to…
This past April, DEV hosted a hackathon in conjunction with Twilio (here’s a referral link for a $10 credit). This seemed like a good chance to play around with the Twilio API, so I created a small project called Morning Joy. It lets you start each day on a good note by texting you an uplifting news story and a picture of something cute.
Following the news can be stressful or even depressing. This is one small way to remember that good things are happening too.
Here’s an example from the first day:
I may earn commissions from purchases made through affiliate links in this post.
Over the past several months, my 2018 15" MacBook Pro developed thermal performance issues. Here’s what I did to fix the problem. The two key changes were that I switched to using the right side Thunderbolt 3 ports instead of the left side ones, and I cleaned the dust buildup in the internal fans.
The problem first started when I noticed my CPU usage spiking to near 100%. In the process list, I saw
kernel_task taking up most of the CPU.
I learned that macOS does this…
I recently needed to clear a large amount of space on my Mac’s hard drive in order to install Windows through Boot Camp. After deleting files and applications, I still had large amounts of space taken up in ways that I didn’t understand. Here is what I did to fix the problem.
The obvious thing to start with was deleting known files and applications. In particular, I removed some built-in macOS applications, like GarageBand, that I can always re-download from the Mac App Store.
I also cleared the trash. As a tip, you probably want to set it to automatically…
Many services recommend using Google Authenticator for 2FA. I originally used it before switching to Authy, but I switched for a reason that is still valid today: it doesn’t have any sort of backup or syncing functionality.
Check out the reviews to get a sense of how often people get burned by switching to a new phone for whatever reason and realizing they’ve lost all their codes or need to go through each…
A small quality of life improvement for programming-related websites is to add copy to clipboard buttons to code blocks. When a visitor wants to copy a code example or a shell command, it’s nice to be able to just hit a button rather than manually select the text, right click, and press copy.
I use Hugo to build my personal website. While Hugo has built-in support for syntax highlighting, it doesn’t support copy buttons. Here is how I added the feature to my website. The end result looks like this:
I inspected the source of a page with code blocks…
One benefit of building my personal website from scratch instead of using a theme made by someone else is that I can start from the browser’s defaults and gradually add my own flourishes. I strive to keep my site lean, but making it personal is also kind of the point. There is a spectrum of gratuitous touches between the spartan pages of Hacker News and Craigslist on one end and the sensory overload of old MySpace on the other.
I’ve been using Gmail for my primary email address for over 13 years. I should thank my sister for making me use my name and not my now embarrassing AIM username. Here’s a look at the welcome email back in 2005. Gmail wasn’t even a year old yet.
Gmail has served me well since then, but mostly for fun (and partly because of vanity), I recently set up an email address on my own domain. I ended up going with a free solution that involves Mailgun and is good enough for my purposes. I wanted to still use my Gmail…