EmberJS helper to format money values.

In your EmberJS applications you may need something similar to number_to_currency to work on template values. Here's how you can easily write a helper to do just that. First, register the helper for your Ember app. Ember.Handlebars.helper('money', function(value, options) { if (value === null) { return new…

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…