11 Dec 2014
Github’s network graph is one most elegant tools to track your project’s progress. Open the network graph of you current project with this shell script. Just type network. function network(){ url=$(git remote -v | grep origin | awk 'FNR == 2{print $2}') sub_path=$(echo ${url##*github.com}) project_name=$(echo ${sub_path:1} | rev | cut...
07 Sep 2014
Internationalization is the process of abstracting all strings out of your application. Rails provides excellent support for Internationalization. Rails’ internationalization works well when views are built the Rails way. But when we are looking to build SPAs and front-end heavy applications, we often end up hard-coding error messages, response status...
15 Aug 2014
Parallelization is a powerful concept. It can speedup execution n-fold. A lot of processes are inherently concurrent. Such processes have to be identified and exploited. These days most computers run on multi-core processors. If we run existing applications on multi-core systems, there might be no visible performance difference. We need...
04 Aug 2014
tmux is an awesome tool for developers to improve their workflow. Here I am going to cover some of the basic functionalities along with the aliases that I use, for you guys to start with tmux. tmux.conf The ~/.tmux.conf file is a config file for tmux. The tmux global configs...
01 Aug 2014
An upsert is update or insert. Upsert in database terms refers to an operation which should insert a row into a database table if it doesn’t not already exist, or update it if it does. One can implement this function in Rails by writing an ActiveRecordExtension. This will allow you...
30 Jul 2014
##Life without Observers Let’s say you need to listen to changes in a model’s attributes and trigger some events based on those changes. If you look at the following example, I’ve done exaclty that. If the status of application is changed an email is sent. class Application < ActiveRecord::Base after_save...
15 Jul 2014
All of us have faced this situation when, the current_resource object provided by devise turns out to be nil. All method invocations on current_resource on current_resource will throw an undefined method for nil:NilClass exception. To handle this, we can try one of the following. 1. current_resource.name rescue nil 2. current_resource.try(:name)...
11 Jul 2014
Git is a developer’s best friend. When ever you screw up, git is always there to save the day. Here are some cool bash scripts to optimize your git workflow. Add the following snippets to your .bash_profile and voila. ##1.Know where you are. Often you forget which branch you are...
05 May 2014
Git is one of my favorite softwares. It always impresses me. Here is one of the awesome tools in git. Let us consider a scenario where you modify a file and you just want to stage a part of the file. You stage hunk by hunk in git using the...
02 May 2014
Callback Hell? A callback is a block of code passed an an argument to a function, which can be executed by the function at a suitable time. There is nothing wrong with callbacks, but when you have conditions where you have multiple callbacks nested within each other, it becomes very...
28 Apr 2014
Let us consider a problem in which we have a Car class. The top speed of any car is a maximum of 100kmph but by adding extra power packs to the car we can increase the speed of the car. These packs are Nitro and Boost. Nitro increases the speed...
05 Jan 2014
Starting off in a predominantly Ruby on Rails consulting firm like Codebrahma, whilst still in college and with no prior ruby experience seemed daunting at first. I spent most of last month getting used to the ‘Ruby Way’ of doing things. I’m far form mastering ruby, but I’m able to...
04 Jan 2014
Are you a start up in search of solution for your technology needs. Are you a Local Business trying to start or grow your company’s online presence and engagement in your locality ? Read Further. Technology & Internet have changed the face of how we do Business today and it...
19 Jul 2013
Clients tend to feel concerned when they offshore their development. They worry if the dev team will align with their thought process. Here are a few methods to have a very efficient offshoring process. Stand up calls Have Stand up skype calls in the morning. Talk about the progress made...
18 Jun 2013
SOA, an abbreviation that is frequent in text-books, but not so much in codebases. Lets demystify SOA. Lets say you want to build a Flight Ticket Booking website. Basically you get the users requirements and search from expedia and other service providers. the monolithic way of doing this is You...