How to install Ember-CLI in Mac Yosemite.

Here's how you can install ember-cli in Mac Yosemite. Install NodeJS using HomeBrew: brew install node node -v npm -v brew update brew upgrade node Install the Ember Google Chrome Extension: https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi?hl=en Install Watchman (to build project on file save automatically…

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…