Monorepos are brilliant in the right use cases, but often not without a cause-questioning level of setup complication. In the JavaScript ecosystem, Yarn Workspaces provides a mature tool for managing dependencies near-seamlessly, however this is not pairable with a React Native app by default.
Last year I undertook a migration to merge our previously separate frontend repositories into (what has become) our largest codebase. Amongst these was a vanilla (non-Expo) React Native app. …
So far in my time using Unix systems I have stuck with Bash as my preferred shell environment. This is for various reasons, but mostly for its ubiquity. There are well-known alternative shell projects such as zsh, which build upon Bash with an “add more” attitude, but that hadn’t swayed me to become a long-term user in the past.
Fish is a significant departure from Bash, released in 2005 with the brilliant slogan, “Finally, a command line shell for the 90s”. With a bit of time and curiosity, it seemed worthwhile to give it a quick try.
The need for a plugin framework or patched nerd font to configure my shell environment never really appealed to me. With Bash I had only built up a humble selection of aliases, exports and functions, with the aim of minimalism and portability (setup on new systems involves simply running stow bash
from my dotfiles repository). With fish I’ve ended up needing to configure less things, and what I have is noticeably cleaner. …
Vim remains a powerful and ubiquitous application to tackle any number of text editing tasks conveniently from the terminal (some learning required). If you’re looking to add Vim to your toolkit this year, here is my list of absolutely essential plugins to begin supercharging your workflow.
If you’ve never set up a Vim plugin before, see the Installing Vim plugins section later on for a runthrough.
https://github.com/junegunn/fzf.vim
Working on a substantial codebase usually involves traversing several files at a time. …
A few months ago I authored a small Sublime Text plugin called Sublime tmux, providing a set of commands to open windows within tmux sessions directly from the editor. Even though it seemed mostly finished upon release, I ended up introducing several small things which unveiled a non-trivial number of edge cases which I’d wished were covered by tests. I hadn’t approached unit testing within a Sublime package before (or in Python!), but this was a definite time to get started.
At Digital Detox we currently compose our JavaScript tests using Jest, which allows us to rapidly iterate thanks the use of test snapshots. This involves writing select data fragments (snapshots) to a file and diffing against these in subsequent runs, putting any changes to an API surface up for review. This approach would be a really perfect fit here, and as such I was determined try to make this — as far as I can tell — the first use of snapshot testing in a Sublime package. …
UUIDs are awesome — they provide a non-sequential, comprehensively unique identifier that can be generated separately from the source database. However, if you need to include one in a URL they can appear somewhat inelegant.
2b8b9396-0cdf-4b9c-a03d-b25e1d93601b
Recently, I was migrating a PHP application and database from auto increment to UUID 4 strings. In several instances, resource IDs had been referenced in the URL and obfuscated to a short, clean hash ID padded to six characters in length. These identifiers still needed to exist, and we needed to use UUIDs — so would they need to be displayed everywhere in full?
The Hash IDs package used generates identifiers from characters in the range [0-9A-Za-z]
. This is an encoding with a 62 digit base; a subset of the characters valid in a URL path. …