Making and Using HTTP Middleware

When you're building a web application there's probably some shared functionality that you want to run for many (or even all) HTTP requests. You might want to log every request, gzip every response, or check a cache before doing some expensive processing. One way of organising...

Interface pollution in Go

If there was a single powerful language feature in Go, it’d be the interfaces. The internals of Go contain strong combinations of useful ideas from various type systems and inevitably they ring the curiosity bells. I recently surveyed Github for Go interface declarations, and t...

Error Handling In Go, Part I

Introduction It is idiomatic in Go to use the error interface type as the return type for any error that is going to be returned from a function or method. This interface is used by all the functions and methods in the standard library that return errors. For example, here is the...

Elections, in Ruby

Updated with second round script in Oct 26, 2014. Well, last sunday (Oct 5) was the brazilian elections. I was doing nothing, so I decided to write a simple ruby script to parse the results and show the top 3 candidates. Besides the reverse clean-code done by the TSE (Superior El...

Hugo Summer 2014 Update

Hugo, the fast and flexible static site generator, is really coming of age. I wanted to give a quick update about the progress Hugo has been making over the past couple months. New Website Hugo can now be found at http://gohugo.io. Update your bookmarks. New Team Members I want t...

A Class Factory in Golang (Google Go)

Do you know what a class factory is and why is it useful?  Ever considered implementing a class factory in Golang (Google Go) even though Go is not considered fully object oriented in nature? Are you curious about some awesome features in Go other than it’s impressive c...

Evangelism is NOT Sales

I recently had a discussion with a CFO of a technology company. We were meeting because he is trying to better understand the role technical evangelism could play within his company. Ten minutes into our conversation he said, “so evangelism is pretty much rogue sales”...

Go Compiler nil Pointer Checks

Introduction I was thinking about how the compiler looks to protect the code we write when it can. Invalid memory access checks are one type of safety check the compiler adds to our code. We might think that this "extra code" is hurting our performance and maybe over bi...

ALS Ice Bucket Challenge - Go Style

If you have not heard about the ALS Ice Bucket Challenge I would be surprised. It’s everywhere nowadays, being done by celebrities alike. After being challenged by my children there was only one person, or should I say Gopher, I knew I needed to nominate. The Gopher took to...

Install JDK on OSX Yosemite

For some reason, Oracle blocked the installers to run only on a fixed OSX version range with a nice and explanatory error message. This range doesn’t include Yosemite, which makes sense, since nobody running Yosemite will ever want to write some Java. Anyway, here is how to...