Golang Vanity URLs in nginx

in   code   ,

Go has a nice way of importing packages, just use go get and it automatically appears in your $GOPATH/src directory. The backing store can be any supported VCS, but most often is GitHub. This means that your custom package will be namespaced under github.com/<user>/package. Wouldn’t it be nice if you could just namespace it similar to rsc.io/quote?

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 →

Random text plugin for Octopress

in   Code   , ,

Why a random text plugin? Just because I can. It’s easy enough to implement and with just a little knowledge of Ruby and knowing how to search the internet for some JavaScript, it’s a piece of cake.

Read more →

Handling 404 errors with Octopress

in   Code   , ,

Building a blog with Octopress can be a bit of a hassle at times. Having converted from Wordpress, I miss the “Page not found” error that Wordpress provides when you get a request for an invalid URL. Thankfully, with Apache, htaccess and a touch of code, you can create your own 404 page.

Read more →