Day 23 - RTFM, please

Today’s challenge: spend 20 minutes reading the docs for something you’d like to know a little better.

Ideally, this should be something that’s already in your dev toolchain or used by your app. That’ll let you apply what you learn right away.

You might want to investigate the docs for one of these:

  • Your text editor. Vim users: type :h , search for “Editing Effectively” or “Tuning Vim”, read one of the docs in that section.
  • Your database. Any unused features you might leverage?.
  • A library or framework you use frequently. Have recent releases added anything useful?
  • Your shell. Can you optimize your workflows? Refactor a shell script? Improve your prompt?
  • Your programming language. Anything new or unexplored there?

If you discover something new, try to use it right away. If you can’t, maybe jot it down on a sheet of paper next to your keyboard so you remember to try it later. I do this often to teach myself new Vim commands. Once the new stuff is in my muscle memory, I throw the sheet away.


Another thing that I do related to RTFM is keeping a clone of frequent repositories on my machine.

Let’s say, for example, that I work with Ruby on Rails every day, and I need to dive into the source code from time to time to see how things work under the hood, and the docs don’t help that much. I’ll go to the GitHub repo, copy the path and do a git clone REPO_PATH somewhere in a misc directory on my machine.

Next, I use the Project Manager VSCode extension to make a bookmark in VSCode about that directory.

Then, in a few days, weeks, or months, when I need to see what an obscure helper method does behind the scenes, I just open the project manager, select the Rails project, and now I have the full power of my IDE to browse the repo instead of the clunky click-and-wait method on GitHub.

In the long run it saves a ton of time💪

I read up on some Redis operations. We use Redis to cache some analysis results. Redis’s expiring keys feature provides us a simple way to clear out the analysis results when they become stale. But, we are looking at changing the results to be a count, rather than a simple present/absence for the key.

Right now we can use the SET operation with the EX option to handle inserting the key and setting the expiry, or updating the expiry if it’s already present. There is an INCR operation, but it doesn’t update expiry. So I think we will need either an INCR-EXPIRE sequence or a GET-SET EX sequence. Something to chew on.

I happened upon their description of distributed locks, which they call Redlock, which looks like an interesting read for another time.