Bits and bytes of code

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

If you haven't tried the Arc browser I highly recommend giving it a try. It's a fantastic rethinking of how a web browser should work, with tons of goodies packed inside.

Using bold to emphasize text is great in certain scenarios, but it can be difficult to distinguish bold text from normal text, especially in dark mode.

Hammerspoon is a fantastic tool for automating common tasks such as window management, hotkeys, and much more. It uses Lua to allow you to interface with many low-level macOS APIs. Recently I improved my config to manage Focus (do not disturb).

macOS a robust tool for scheduling automated tasks: launchd. While quite different for those used to cron, it's a pretty great tool for scheduling jobs.

I've been using ripgrep for some time now, and figured it would be great to share for anyone who hasn't used it before.

Tailwind is a fantastic CSS framework that makes it so simple to write CSS code. However, sometimes you need to break outside the boundaries of the set of default classes and do something a little custom.

Managing z-indexing can be a real pain at times. Dealing with many different elements, all of which have to specify different z-index values to ensure the correct stacking context. Thankfully, the CSS isolation property can help remove some of the hassle.

GBrowse on main branch

The :GBrowse command from vim-fugitive is a great way to open a file or range in the configured upstream provider (e.g. GitHub). However, it's usually a pain since it opens in the current branch, which is often not pushed.

Vim Scratch Buffers

I use scratch (unnamed) buffers in Vim a fair bit when working with text manipulation for content not saved to a file such as editing some JSON, or building some commands to run from a list of ids. Knowing how to easily create scratch buffers is a must have when using Vim.

Using localStorage is great for storing simple user preferences such as the expanded/collapsed state of a sidebar, or the light/dark theme preference for the site. An often overlooked but useful feature of localStorage is the ability to sync changes between open tabs.