Recent Posts

Docker on Rails 7

2 minute read

Simple dev bootstrap rails with docker-compose. You’ll be up and running as quickly as 1..2…3!

github and multiple oauth provider

Allowing users to login with multiple authentication providers brings great benefits but also results in some annoying edge cases. For example, what happens ...

ruby timeout

standard timeout require 'timeout' begin complete_results = Timeout.timeout(1) do sleep(2) end rescue Timeout::Error puts 'Print me something ...

heroku deploy procedure

Just keep record of the procedure to deploy heroku install heroku heroku gem(deprecated) or toolbelt sudo aptitude install heroku-toolbelt #or for ubuntu wge...

Sudo vs RVMSudo

RVM is a great command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems. Thi...

Working with Digests and Signatures

###MD5 digests### MD5 is a one-way hashing algorithm for creating digest “signatures” or checksums of strings. MD5 digests are 128 bit (16 byte) signatures. ...

Extend vs Include in Ruby Module

Extend vs. Include Modules are used for mixins, ruby’s way of handling muliple inheritance without the complications. There are two ways to mixin, either in...

cases and switches in ruby

One of the common questions that we get about people coming from other programing languages is with the way switch cases work in ruby.

Change Computer/Host Name Mac OsX

One of the most common problems that we come across is when the programmer tries to setup the Mac OS X - name/hostname for the computer, since it takes up mo...

Git alias

Following are some of the common git aliases, people use. Add them to ~/.bash_profile

GCC command line tools

When the bundling gems fail in Mac OS X, Download the latest GCC standalone file from the link below:

octopress no lexer error

just got error /Users/ken/.rvm/gems/ruby-1.9.3-p327/gems/rubypython-0.5.3/lib/rubypython/rubypyproxy.rb:198:in `method_missing’: ClassNotFound: no lexer f...

retry and retry code blocks

simple way to rescue and retry several tries = 0 begin # some routine rescue tries += 1 retry if tries <= 3 puts "no dice!" end #or 3.times do b...

ruby selenium-webdriver watir-webdriver

There are many other Selenium gems out there, but this is the only official, maintained gem. If you’re looking for a slightly higher level API built on the s...

how to revert git commit remote

First, There are serveral revert situation: Local: # this will detach your HEAD, i.e. leave you with no branch checked out. git checkout 0d1d7fc32 git checko...

happy number and prime

A happy number is defined by the following process. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repea...

triangle problem

Starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.