Home

Awesome

Gem

til-rb

A work-in-progress tool to maintain a TIL repo.

Inspiration: https://github.com/jbranchaud/til

See it in action below:

til in action

Internals

I wrote a blog post about the interesting parts of the til internals, specifically:

Installation

Step 1: Install the gem

gem install til-rb

You will also need fzf to run til, it's available on homebrew, so unless you already installed it, you'll have to run

brew install fzf

fzf is technically not a hard requirement, we really could have a slightly different workflow if it's not available. Given that I currently am the only user, there's no need to change this at the moment, but if you'd like to use this gem without fzf, let me know and I'll happily work on it!

Step 2: Create a GitHub repo

You need a GitHub repo to store your TILs. The gem has pretty strict expectations about the format of the README.md file, so I recommend forking this repo, or just copying the content to a fresh new repo.

Note: The format expectations mentioned above are the following:

Step 3: Add the environment variables

Add the following variables to your environment:

You might want to add those to either your .bashrc or .zshrc but please be careful in case you share those publicly as the token is private and must not be shared publicly.

Note: An earlier version of this gem used different names, GH_TOKEN & GH_REPO, it still works, but is not the recommended approach anymore, see #2.

Step 4:

Run til from the command line

Future improvements

Known issues

The current version (0.0.5) deletes the temporary file before attempting to create the new commit, so if anything goes wrong there, the content of the file will be lost. This will be fixed soon, by only deleting the temporary file after the commit was created, but please keep that in mind if you typed a long TIL and definitely don't want to lose its content.