Bootstrap Navigation Tabs in Hugo

in   Hugo   ,

One feature of Bootstrap that I like is the tabbable content , which allows the user to create tabs of local content. One common use-case is to show multiple syntax highlighted code blocks that showcase the same problem, and how to achieve it in different languages. While this can be achieved by writing HTML directly in the content, it is a lot of extra boilerplate content that could be automated, and makes it much easier on the author to focus on the code content. Read more →

Custom Error Pages in Hugo

in   Hugo  

Hugo is a well known static-site generator, which is what I’m using to generate this website. I also like to have a custom error page for different HTTP errors, such as 404, 403, etc., and I like them to be in the same style as the rest of the website.

Read more →

Switching to Hugo

in   , ,

After a few years of silence on the blog front, I tried to switch my website to use HTTPS everywhere. However, the existing Middleman based website had references to insecure HTTP resources, which caused a blanket switch to HTTPS to cause the site to fail to load correctly.

Read more →

Why programming is so hard

in   Code  

While a computer is simply a machine that takes in a series of instructions and executes them in order, most people have a hard time understanding this fact. As Arthur C. Clarke wrote

Any sufficiently advanced technology is indistinguishable from magic.

Arthur C. Clarke in Profiles of the Future (1973)

My observations from my own experiences appear to stand as evidence of the above statement.

Read more →

Metaprogramming in Ruby

in   Code   , ,

Recently, I developed a configuration DSL that would populate a database. I found myself writing a lot of repetitive code to handle the DSL syntax, and thought that this would be a good case to programatically generate the methods.

Read more →