Tutorials Page 5
How to Get Mac Battery Level from Command Line
I'm a big fan of having as much information as I can get within the command line. I couldn't go without knowing which git branch I'm on, for example. Another important piece of information I like having is my current battery percentage.To get...
How to Block a Range of IP Addresses
As much as content creators want traffic to their website, there is such thing as the wrong type of traffic. Sometimes it's content scrapers, sometimes it's malicious bots; either way, it's important to know how to block problematic IPs from your site.To block a range...
Detect the Content Type in the Clipboard
A user's clipboard is a "catch all" between the operating system and the apps employed on it. When you use a web browser, you can highlight text or right-click an image and select "Copy Image". That made me think about how developers can detect what is...
CSS ::file-selector-button
We all love beautifully styled
form
controls but, due to the differences between operating system displays, styling them can be painful. Due to that pain, we've created scores of libraries to mock these controls. Unfortunately that sometimes comes at the cost of accessibility, performance...How to Open a Tor Brave Window from Command Line
I love the Brave web browser for many reasons: ad blocking, Brave rewards, crypto integration, and even a Tor tab feature. I'll often use the Tor feature but wanted to know how I could automated opening Tor windows from command line.To open a Brave Tor...
How to Open an App from Anywhere on Mac Command Line
Many engineers like myself live in the command line, and perform actions from command line that most others would click an icon for. I've always found opening apps from command line on Macs painful. You need to references the
Applications
directory, add.app
to...How to Create a Diff of Two Images
When I was a child, I loved looking for Waldo in the "Where's Waldo?" book series. These days I'm a sucker for TMZ's "What's the Big Frigin Difference" images, where TMZ slightly changes an image and you have to spot the differences between the two.
5 Web Design Trends for 2023 That You Should Pay Attention To
The start of a new year is usually a time when we start looking for ways to make something a little better. That something could be our life, work, or what we produce. Web designers, for example, might look for ways to make their designs more...
fetch with Timeout
A few years back I wrote a blog post about how write a
fetch
Promise that times out. The function was effective but the code wasn't great, mostly becauseAbortController
, which allows you to cancel a fetch Promise, did not yet exist. With...Customizing HTML Form Validation
Form validation has always been my least favorite part of web development. You need to duplicate validation on both client and server sides, handle loads of events, and worry about form element styling. To aid form validation, the HTML spec added some new form attributes...