Sunday, May 25, 2014

Learnings from participation in my first Open Hack

Hi there,

I’m grateful to Multunus for hosting an Open Hack on 24/5/2014. Let me just start with telling you a small tale on how I made it there. Read on :)

Background -

The day I heard about this event and by the time I registered for it, I was quite late. But nevertheless, I dropped a mail to Vaishnavi from Multunus and she promptly replied and asked me to register on the waiting list although I had faint hopes of actually making it back then. Just one day prior to the actual event I got a mail from her in which she mentioned about a last minute drop out and I was happy I could fill in that person’s shoes. 

Getting Started -

Coming up with ideas for the open hack could be interesting as you can even take up something inpromptu. Some of the participants did come with some plans as to what they'd want to work(which is a good thing in its own way). The way people ended up working on ideas was after their self introduction and also after stating what they'd like to work on with what language they'd like to use for the same. I think the best part of this brainstorming session was that when anybody came up with an idea as to what they'd want to work on, ideas kept coming from other participants as to what else they can do to or how they can actually better go about better implementing the original idea. 

For instance, this happened with me. I wanted to contribute to Rails documentation and I was suggested why don't I try running a spell checker on the app to get a quick fix :). I was like yeah, why didn't I think about this... Hmm..

Learnings

I've just tried to pen down some of the learnings that I had as part of my participation at the event. I'd be glad if someone finds it useful.

a. For contributing to the Rails documentation, you don’t really have to run your tests. When we commit any documentation back to Rails, what we need to do is add [ci-skip] as part of the commit message.

b. The exact path where you’d want to contribute to the rails documentation would be - https://github.com/rails/rails/tree/master/guides/source

c. I always wanted to know why so many developers these days are using Mac till date. During Lunch I had a discussion with a couple of well experienced folks(Swanand, Nikhil) who were using Mac and they gave me great insights on how Mac can help speed up your development on a day to day basis in comparison to Linux based machines. Their inputs are summarized below to what best I can recall -
i. One of the most important pointers that I found during the discussion was that the defaults that Mac comes with wrt Rails development help you really speed up your work.
ii. They also mentioned that Apple comes with great hardware. The Mac book Air for instance comes with 8-9 hours on an average with a single charge.
iii. Also they recommended to get it from the US in case you’d like to save some money and in case you’re buying from India, buying from an Apple Store would mostly be your best bet to get the latest products.

d. Couple of useful links that can help you getting started when you want to contribute to rails -

e. I learnt about a new rake command- rake -A -T
i. rake -A: gives you the list of rake tasks which have a comment about what each one does.
ii. rake -A -T : Not only gives you the list of those rake tasks which mention what each task could do but it also lists down those rake tasks which don’t have a comment against them as to what they can do.

f. Generate Raw SQL using ActiveRecord::Base.connection.execute and extracting a hash out of the same


   
g. If you want to upgrade your Rails project, this link will be very project might be very helpful - http://railsdiff.org/

h. In case you want to contribute to an Open Source Project and don’t know where to get started the best thing you can do in such a case is -
i. Clone the project
ii. Grep for to do or fix me and that should get you started...

Some Pics taken at the OpenHack -






All in all, I don’t think I would have learnt this much if I wouldn’t have attended the event. I can definitely tell you that you’re being regular to such events/meetups really broadens your perspective around things and definitely helps you ending up learning more. 

Lastly, I would once again thank Vaidy and team at Multunus for being such good hosts.

Thank you.

Credits to Dheeraj Kumar for points e. and f. 

P.S.: Credits to all those inputs helped learn me new things. I’m sorry if I missed mentioning anybody’s names, I'm not able to recall all of their names at the moment. Feel free to correct me/comment below in case I missed something or in case you’d like to add more pointers with respect to the above article.

Saturday, May 17, 2014

Useful RVM commands

RVM stands for Ruby Version Manager. A handy tool to help you manage different Rails projects(on different versions of rails) that you've setup on your system. It also help you easily switch between different Ruby versions.

Below are some useful rvm commands that I use from time to time-
1. rvm list known
To list all *known* RVM installable Rubies
2. rvm current
The current version of rvm you're using
3. rvm gemset create gemset_name
To create a new gemset. It's quite useful when you're system has multiple apps installed, each using different versions of ruby/rails
4. rvm get stable
Helps you upgrade to the most stable version
5. rvm list
Lists the different installed rvm rubies
Sample Output -

rvm rubies

ruby-1.9.3-p327 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
=> ruby-2.0.0-p451 [ i686 ]
ruby-2.1.1 [ i686 ]
* ruby-2.1.2 [ i686 ]

# => - current
# =* - current && default
# * - default
6. rvm install 2.1.2
To install a particular ruby version via rvm.

7. rvm gemset use gemset_name

It uses a specific gemset specified by the gemset_name

8. rvm set default ruby

Helps you set up a default ruby version you'd like to use as soon as you open up your terminal

rvm --default use 1.9.3-p374

9. Create the ruby version that your project should default to when you change directory(cd) into it

rvm --create --ruby-version ruby-2.2.2@my_project

Here, my_project stands for the gemset you'd be using for this project.

10. rvm info

It gives you information about your ruby environments.