Bits and bytes of code

Bytes is my collection of short-form posts, tips, and things I learn as I build software.

CSS has a relative new feature for building relative colors based on a source color. This allows you to make small changes to a color value without fully redefining it. One interesting use case for this syntax is changing the opacity of hex colors.

Ever wanted to run a super simple timer directly from the command line? Oh, you haven't? Well, you can still read this anyway since you might learn something 😂.

The sr-only class is a common convention for visually hiding an element while keeping it visible to screen readers. If not implemented properly though, it can cause some unexpected overflow due to absolute positioning.

In a recent side project I came upon the need to securely store credentials in a database that I can later retrieve and use as part of the application. I know that Node.js has a very extensive crypto module, so I knew it was possible, though I wasn't sure on the specifics.

I've been using Go a bit more lately for a side project I'm working on and I ran into a few instances where I needed to do use type assertions for some fairly flexible interfaces. While I could easily do what I needed to, it still feels weird.

Netlify has support for creating redirects and rewrites using the _redirects file syntax. Borrowing from an idea I saw from Kent C. Dodds and @caarlos0, I built a script to make it easy to create short links for my website or other sites that I can then access via my newly minted go.mskelton.dev subdomain.

I recently started using a tool called Zoxide from a friend's recommendation and I must say, it's pretty awesome. Zoxide is a smarter cd command that tracks your most used directories and allows you to jump to them with ease.

Building slideshows using Markdown is really convenient and fast. There are three great projects on GitHub which do this well, but I always forget their names, so posting them in this Byte for my own reference but also to promote each of these great open source projects.

Something that came up at work recently was joining buttons into a group. When joined, we wanted the buttons to have no border radius between them to achieve a nice visual aesthetic.

I've been working on a Rust side project lately and as I always do when I write Rust code, I find myself loving pattern matching even more than I did before. It seems like such a simple thing, sort of just a better if statement, but the more you use it, the more you realize just how powerful and elegant it really is.