Simple Go logging using Logrus.

I've been looking for a feature complete logging package for Go this weekend. I found Logrus and it's really easy to set up and powerful. First, let's import the package to our sample application. package main import ( "github.com/sirupsen/logrus" ) func main() { } run go get in your terminal. To…

How to use Active_Enum with SimpleForm?

Here's how you can use the Active_Enum gem with SimpleForm inside a Ruby on Rails 4 application. Your situation: You have a column in your model of type integer. You have an enumeration in your model. You're using the simple_form gem. Here's how to quickly integrate it your…

Return HTTP status codes using Go.

Go's net/http package provides a intuitive way to return status codes from your handler functions. In this small example, I'll show you how to return http status codes from a given http handler function. package main import ( "net/http" "github.com/bmizerany/pat" ) var mux = pat.New() func main…

How to stop your Go http server.

When you run a simple HTTP server in Go you don't really see it 'open' in the terminal. You just run it, and the process is fired and it holds on to a port for traffic. There is no Ctrl+C to actually kill the server. Here's a quick one…

3 Simple Ways to Speed Up Your Rails 4 App.

Websites need to be fast, now more than ever before. Google ranks fast websites higher, more people are using mobile devices to access their favorite sites and fast websites tend to sell better. In this very brief article I'm going to show you 3 simple ways to improve your Rails…

Rails 4 Authentication using Devise.

Today I'm going to give you a quick step-by-step guide on how to implement user authentication from scratch using Devise. This entire tutorial can be completed in about 10 minutes and is very simple to follow. Our end goal is to have users be able to register, log in and…