Ruby Tuesday Summary for May 22nd, 2012 Meetup

Hi all,

Thanks for coming out last night everyone!

For those who couldn’t make it, or would just like a recap, a summary of what happened is below.

Slidedeck from last night

The slides for the May 22nd, 2012 Meetup are available here.

Hanging out in the new Shopify Annex

Shopify has kindly provided us with a great new space to host future meetups!

Check it out —> http://www.meetup.com/OttawaRuby/photos/713604/#122400822

It’s nice, big and open. You can’t see them in the picture, but there’s tables along the outside which will be good for future hacking sessions.

Announcements

We had a few announcements for the upcoming summer speakers. We’ve got some great speakers and interesting talks lined up, namely:

  1. June Speaker: Jeff Casimir - Adventures on the Golden Path

  2. July Speaker (?): Russ Olsen - Topic to be chosen by vote (cast your vote here)

  3. August Speaker: Avdi Grimm - Topic to be announced

More info can be found in the slides here.

Introductions

We went around the room and introduced ourselves, what we’re working on and a bit about our backgrounds. It’s great to see people from all sorts of other languages moving into Ruby.

This is as it should be. ;)

Remote Presentation: Charles Max Wood

Charles Max Wood gave an interesting talk on Cassandra Scalability. I’ll try and get the slide deck and post a link in the Google Group.

A few links:

Mingling, Pizza, and Drinks

After Charles’ talk, we chatted and got to know each other a bit better, while enjoying some pizza and drinks (courtesy of Shopify, thanks guys!).

Hacking on Katas and One-Liners

For those who stuck around after the networking, we had a few Ruby exercises for people to choose from:

  1. Yellow Belt Kata
  2. Gilded Rose Refactoring Kata
  3. Whenbot One-Liners

We didn’t have a lot of time for this part, but some people managed to get started.

Additional details on what these involve can be found here (see slide 20 onward).

What’s next?

Thanks again for coming out! If you missed this one, be sure to come next month. Jeff Casimir has graciously agreed to return for another talk. :)

Here’s the abstract for next month’s talk:

### Adventures on the Golden Path

Rails 1.0 was about proving we could build the same functionality as
the other web frameworks, but doing it faster.
Rails 2.0 was about pushing the vanguard forward, setting new trends
for how the web should be built.
Rails 3.0 paid down technical debt and laid the foundation for our future.

Now what?

Rails has always guided developers down the "golden path" of best
practices. Let's look at potholes needing filling, ways we can
straighten the dangerous corners, and figure out where this road might
be heading.

Sounds like fun. :) I’m thinking some of the content may lead to insights into how we can improve our Rails 3 code before Rails 4 hits.

We hope to see you there!

The Ruby Tuesday Team

Git Tutorial Videos and Presentation

Gitting To Know You videos

For those who are looking to learn more about Git, Casey Li was nice enough to create an introductory video series titled Gitting to Know You (nice title, too :).

Each of the videos are bite-sized (under 15 minutes). By the end of the series, you should have a good grasp of Git and how to use it.

Git Presentation from Girl Develop It

At the April meetup, Gabriel Castro mentioned a presentation on Git that was given during a recent Girl Develop It meetup. If you’re up for some additional information on Git, check out the presentation here.

(To download those, click through the link in the file listing [e.g. GitParty.pdf], and then right-click the “Raw” button and click “Save As.”)

Enjoy!

Git Tutorial Videos and Presentation

Gitting To Know You videos

For those who are looking to learn more about Git, Casey Li was nice enough to create an introductory video series titled Gitting to Know You (nice title, too :).

Each of the videos are bite-sized (under 15 minutes). By the end of the series, you should have a good grasp of Git and how to use it.

Git Presentation from Girl Develop It

At the April meetup, Gabriel Castro mentioned a presentation on Git that was given during a recent Girl Develop It meetup. If you’re up for some additional information on Git, check out the presentation here.

(To download those, click through the link in the file listing [e.g. GitParty.pdf], and then right-click the “Raw” button and click “Save As.”)

Enjoy!

May 22nd, 2012 Agenda

Summary

Hear a talk from Charles Max Wood, meet some fellow Rubyists, and do a bit of hacking.

Time and Place

  • Date: May 22nd, 2012
  • Time: 6:30pm
  • Place: The new Shopify Office: 126 York Street
  • Bring: Yourselves, and your laptops with Ruby installed :)

Plan on coming? Let us know…

We hope you can join us. If you could RSVP here, that would be great.

Tentative Agenda

Exciting news: Moving to the Annex!

This month we’ll be hosting Ruby Tuesday in the Shopify Annex. It’s at the same office location (126 York Street), but in a bigger, better-suited room. :)

1) Introductions and Announcements

We’ll have some brief announcements, and then we’ll go around the room and introduce ourselves and what we’re working on. This will be good to get to know each other a little.

2) Live (remote) presentation by Charles Max Wood

This month, we have Charles Max Wood (Teach Me To Code, the Ruby Rogues podcast, and the Ruby Freelancers Show will be giving us a talk.

The topic will be announced later. But come on out if you’d like to learn something new. :)

3) Break / Food and Networking (20-30 minutes)

Eat, drink, meet some Rubyists! :)

4) A bit of hacking

A few months ago, we tried to do some Ruby katas, but it didn’t go so well since the agenda said that laptops were optional. :\

This month, we’ll be trying these again, with the additional option of working on some Whenbot one-liners (possibly more, time permitting).

There’ll be three options:

  1. Work on some one-liners for Whenbot
  2. Work on a Yellow Belt Kata (for Ruby novices)
  3. Work on the Red Rose Refactoring Kata
  4. …There may be some other fun stuff to work on too. :)

Resources and Wrap up

We hope to see you there!

The Ottawa Ruby Team

April 24th, 2012 Meetup Agenda (Hint: Whenbot coding session!)

Summary

This month we’ll have a coding session to work on our group project: Whenbot. Come on out if you’d like to contribute to a cool, new Open Source project.

Side-Note: Ruby on Rails versions

We’ll be working with Ruby 1.9.3-p125 and Rails 3.2.3. It would be good if you had at least Ruby 1.9.x and Rails 3.2.x installed when you arrive.

Need a guide for installing Ruby on Rails? See this guide for how to install Ruby on Rails using RVM. It covers Mac OS, Ubuntu and Windows.

Plan on coming? Let us know…

We hope you can join us. If you could RSVP here, that would be great.

Tentative Agenda

  • Date: April 24th, 2012
  • Time: 6:30pm
  • Place: The new Shopify Office: 126 York Street
  • Bring: Your laptops, and yourselves.

1) Introductions and Announcements

We’ll have some brief announcements, and then we’ll go around the room and introduce ourselves and what we’re working on. This will be good to get to know each other a little.

2) Getting Started with Contributing to Whenbot

We’ll have a brief introduction on how to contribute to Whenbot, our group project.

3) Let’s code!

Follow the guides to either create your own Whenbot gem, or pull the Whenbot development branch and add in some needed functionality to the main app.

Teaming up with a partner or two is encouraged.

Feel free to raise your hand if you have any questions. We’ll have some people circulating around.

4) Break / Food and Networking (20-30 minutes)

Eat, drink, meet some Rubyists! :)

5) Let’s hack some more!

Back to the room to continue what you were working on before the break.

Resources and Wrap up

We hope to see you there!

The Ottawa Ruby Team

Lessons Learned from a Code Review

The following is a guest post by Casey Li. Below, Casey shares what he learned from a code review by John Duff. Enjoy.

Hey everybody,

John Duff graciously took the time out of his schedule to do some code reviewing of my Open Mic Community site.

I was definitely nervous posting my code as I’d never done that before - but was instantly glad I did - because just from a few (no more than 15) code fixes, I learned a wealth of information. So I highly recommend to everyone - get someone to look at your code - I got out of it more of a learning experience than anything else.

Anyway, I’ve gone through everything, and I thought it’d be good if I shared my lessons learned with everybody so they can tighten up their code too. Below are just some of the highlights:

1. The power of AREL

One of the biggest things I learned was the power of AREL. John had mentioned to me that the great thing about AREL is that is doesn’t actually do a Database query until you actually need the records. The biggest thing here - is that you can chain your query conditions. For example, I had code along the lines of:

if admin
   @open_mics = OpenMic.all
else
   @open_mics = OpenMic.published
end

if filtered && admin
   @open_mics = OpenMic.all.where(...)
else
   @open_mics = OpenMic.published.where(...)
# etc....

There were all these conditions where I would do a different Model query for each. Again, the lesson learned was that I could just daisy chain them because no query was actually being made at that point:

@open_mics = OpenMic.scoped
@open_mics = @open_mics.published unless admin?
@open_mics = @open_mics.where(:city => @city, :prov_state => @prov_state) if @selected_city_prov_state.present?

Basically - AREL returns a Query object (rather than an array of records) that can be further manipulated. Great eye-opener.

http://magicscalingsprinkles.wordpress.com/2010/01/28/why-i-wrote-arel/

2. Let to_json do the work for you

My app has a JQTouch front-end for iPhones, as such - I’m doing a lot of AJAX calls to my rails server code, and returning a lot of json objects. Up to this point, I knew Rails had some built in functionality to turn objects into json objects - but up til now, I only thought about using this with my Model objects / resources - I never thought about using to_json on customized JSON responses.

Before the code review, my code was scattered with code like this:

render :json => " { response : " + success + " , attendee_count : " + @open_mic.users.size.to_s + " } "

As you can see, I was basically creating the entire JSON response as a string - and with a lot of ugly concatenation. A cleaner way to do this is to just create a ruby hash - and call .to_json on it:

render :json => { :response => success, :attendee_count => @open_mic.users.size }.to_json

Much cleaner.

3. Think about where your logic actually belongs

Up until now, I realized the power of using before and after filters in terms of saving you time and code so you DRY. But, sometimes, even if you’re using a before filter for one method, it makes sense to have it - because of the logic of your code. I had a method call “attend” in my OpenMics controller. The method checked if the user was signed in or not in the method - but that is not inherently something a “attend” method should do. The attend method should simply create attend relationship. The signed_in check should really be done in a before_filter.

So big take home - was that before_filter has some semantic meanings beyond saving you time and code that can make your code a lot easier to read.

4. blank?

There were definitely a lot of places where .blank? condensed my code. I attribute this to only half understanding what it did in the past. So do a quick google search for those who don’t know about it.

5. respond_with

This came in handy a lot because I was doing a lot of returns that were essentially returning the same object, but in different formats (html, json, etc.) - a perfect case to use respond_with. A quick read of how to use this condensed a lot of my code.

So those were just some of the major lessons I learned - and honestly - it was just quick google searches on each - and within 3-5 minutes of learning, I had huge gains.

-

Big thanks to John for all his help, and big thanks to the organizers of the Group for giving me a venue to experience this.

Again, highly recommend others get in on this. This group features some of the best Ruby/Rails programmers you’ll meet and they are all incredibly helpful.

Ruby Tuesday Meetup Summary: March 27th, 2012

It was great to see everyone out on Tuesday! For those who couldn’t make it, or would just like a recap, a summary of what happened is below.

Meetup slides are available here.

Introductions

With Jeff’s presentation starting shortly, we had to go quickly for this part. Everyone did a speedy introduction of themselves. Even with the brevity, it was nice to put names to people’s faces, and to hear where everyone is working and what they’re up to. :)

Remote Presentation: Jeff Casimir

Jeff Casimir from JumpstartLab gave a great talk on Metrics-Driven Rails Performance:

Jeff Casimir: Metrics-driven Performance Slides

You can download the slides here.

There was lots of interesting information in this one. We also had an interesting Q&A session.

Here are the original links from the start of the presentation:

  1. JumpstartLab’s Creative Commons Licensed learning materials: http://tutorials.jumpstartlab.com/

  2. You can see more resources from Jeff’s Metrics-Driven Performance talk here.

Mingling, Pizza, Drinks and Food

After Jeff’s talk, we moved over to the kitchen for some food and chatting.

Introduction to the Group Project

Mike attempted to give a quick introduction to the Group Project, explain some core concepts, and discuss its current state. It was a terrible presentation. Just terrible.

This is Mike writing, so I can say that, heh… We’ll have some more guides online and have a better presentation next time. ;)

Gabriel Castro then went over the Whenbot sketches and concepts that he and Sean Evans came up with. They have some very interesting improvements over the original site’s design.

Wrap Up and What’s next?

Overall it was a good night. Everyone seemed to really enjoy the presentation, and the mingling / networking. Oh, and the pizza too! :)

Thanks again for coming out! If you missed this one, be sure to come next month. There won’t be a presentation; instead, we’ll be having a full-out coding session for Whenbot.

Meetup Summary: February 28th, 2012

The February Ruby Tuesday meetup was great. Apart from some audio issues during Peter’s presentation (fixed now, sorry about that), everyone seemed to have a good time, and we got to learn some Redis!

Below is a summary of what happened. You can see the slides here.

Introductions

We took a few minutes to go around the room and introduce ourselves before Peter’s talk. It’s always interesting to hear people’s backgrounds and where they’re using Ruby on Rails.

It’s also great to see the newer developers getting into Ruby!

Live talk with Peter Cooper

Peter Cooper gave us a great talk on Redis, titled Redis, Steady, Go!, and followed it up with some Ruby Trick Shots

Redis, Steady, Go!

Check out the slides here. Peter said that he plans on making a video for this; when he does, we’ll add the link here.

After a bit of Q&A, Peter showed us a few Ruby Trick Shots.

Ruby Trick Shots

We got the Canadian Edition of the talk, complete with an Ottawa Senators logo replacing the head of the boxcar racer. That was a nice touch. :)

You can watch a video with some more trick shot’s from Peter at rubytrickshots.com.

It was an interesting talk, be sure to at least check out the slides.

A few follow up links:

  • To learn more about Peter Cooper, visit his homepage at peterc.org

  • If you want some more Ruby Trickshots (you know you do!) check out rubytrickshots.com

  • Ruby Weekly is Peter’s weekly newsletter with a round up of Ruby news and articles from around the web.

  • Want to take an online Ruby course with Peter? Check out rubyreloaded.com.

Group Project Presentation by John Tajima and John Duff

John Tajima and John Duff went over the High Level Design document for the Group Project, called Whenbot, and explained some of its core concepts.

This looks like it’ll be a fun project!

Food and Schmoozing

We mingled, we ate, we drank and got to know each other better until it was time to go home. Good talks, good times. :)

Agenda for March 27th, 2012 Meetup

Hi there,

Tonight is another Ruby Tuesday meetup!

Come out and learn some performance boosting tips from Jeff Casimir, and mingle with some fellow Ruby Developers. We’re also going to try and get people started on Whenbot (the Group Project) as well.

Plan on coming? Let us know…
We hope you can join us. You can RSVP here (http://www.meetup.com/OttawaRuby/events/49578922/)

New to Ruby or the Rails Framework?
Check out the “Getting Started” blog post at OttawaRuby.ca

Agenda

  • Date: March 27th, 2012
  • Time: 6:30pm
  • Place: The new Shopify Office: 126 York Street
  • Bring: Yourselves, and your laptops :)
  • Summary: Learn how to dramatically improve your app’s performance, meet some Rubyists, and (hopefully) start working on the Group Project.

1) Introductions and Announcements (15 minutes)

We’ll each take 30 seconds to introduce ourselves and what we’re working on. This will be good to get to know each other a little. We’ll then have some brief announcements, and jump straight into Jeff’s talk.

2) Live (remote) presentation by the spectacular Jeff Casimir (30-45 minutes)

Jeff Casimir (JumpstartLab founder, World-travelling Ruby on Rails teacher, speaker) will be giving a talk on Metrics-Driven Ruby/Rails Performance. Here’s the synopsis:


——

In this talk, we’ll look at identifying hotspots in your code including:

  • Excessive CPU usage
  • Memory and object allocation
  • Monitoring query count and duration
  • Isolating data-store bottlenecks


This is about identifying the 1% of your code that, through optimization, can dramatically improve performance.
——

This should be a great talk, be sure to stop by!

3) Break / Food and Networking (20-30 minutes)

Eat, drink, meet some Rubyists! :)

4) Group Project - Let’s get started!

We’re hoping to have everyone get started on the group project tonight! (Stay tuned!)

Resources and Wrap up


We hope to see you there!

The Ottawa Ruby Team 

Ruby newbie? Some links for you…

A few weeks ago, Alex Hudici asked

I’ve been looking into attending the Ruby meetups, however I am completely new to Ruby… [is there] a place for me and my lack of expertise in any of the projects you mentioned in the group discussion/survey?

The short answer is: Absolutely! We definitely want to encourage new Ruby developers to come to the meetups and participate in the group projects.

“Okay,” you say, “but how can I contribute if I don’t know any Ruby?”

Well, I’m glad you asked! :)

It seems like there are a number of group members who want to learn Ruby, but may not be sure where to start.

So, let’s try and get you started. :)

First things first though. If there’s one thing a completely new Ruby on Rails developer should know before starting on their journey, it’s this:


The key to being a good Ruby on Rails Developer is learning to be a good _Ruby_ Developer.

Ruby is at the core of everything you’ll do as a Ruby on Rails Developer. Ruby is the language, and Rails is the tool that you use to speed up your development. 

Having a strong foundation in Ruby is super important; so study to understand Ruby first, then move on to Rails. And as you continue to improve your Rails knowledge, don’t neglect to improve your Ruby skills as well.

N.B. Well, this is just my humble opinion on this. Do you have another viewpoint? Let us know in the comments.

Now that we have that out of the way, let’s move on to the links. Pretty much, this is the same advice that Alex H. got:


Installing Ruby on Rails

If you don’t have Ruby installed just yet, follow the instructions in Michael Hartl’s Rails Tutorial. He’ll walk you through installing Ruby on Rails for Mac OSX, Linux and Windows.
 

Where to Start?

As for how to get started on Ruby on Rails, I’d suggest checking out the resources in Edward Ocampo-gooding’s Learning Basic Programming post.

From the links on that page, you should first start by getting a foundation in Ruby, as mentioned above. So, going through http://tryruby.org and Learn Ruby The Hard Way is a good way to go. 

Just in case you came to this post late and you need to learn Ruby quickly for, say, a Ruby meetup of some sort ;), here’s some advice on how to get a quick handle on Ruby.

  1. Go through tryruby.org. This will teach you some of Ruby’s basics.
     
  2. Next, read through Ruby in Twenty Minutes. Follow along with the examples. This will get you writing some methods and classes, which tryruby.org seems to gloss over.

    Side-Note: If you don’t have Ruby installed yet, you can code up the examples online using Repl.it, which gives you an interactive Ruby console in your browser. 
     
  3. If you’d like to review and solidify what you just learned, check out JumpstartLab’s “Ruby in 100 Minutes” tutorial.
     
  4. If you have time to go further, move on to Learn Ruby The Hard Way.


Getting on Rails

Once you’re comfortable with Ruby, you should move on to learning Rails.

Rails Guides is the standard place to go to learn about Rails concepts, and it proves useful for beginner and advanced Rails Developers alike. The Getting Started With Rails guide is a good place to start on that site, and you can dive deeper into other concepts by checking out the main page.

It’d be good to go through the Rails For Zombies videos. And if you like videos, another one you may want to watch is The Intro to Rails Screencast I Wish I Had.

(Note that neither of those videos use the latest version of Rails [v3.2.2, as of this writing], as far as I know; so you may have a bit of catching up to do. Still, they’re good resources, and should help give you a good grasp of some of the core Rails concepts.)

For a more structure approach, you can read Michael Hartl (free) book, Rails Tutorial: Learn Rails by Example

In Michael Hartl’s book, he walks you through creating an app from scratch; but once you feel comfortable enough in Rails, you really should try and create your own project. Writing your own app is one of the best ways to learn Ruby on Rails.


Prefer the classroom feel?

One of our members, Ramon Brooker, is offering a four-week Introduction to Ruby on Rails course. Ramon has been using Rails since version 0.5, so he knows his stuff.

For more info, visit this search page on the Ottawa-Carleton District School Board site, and enter one of the following in the search box on the left:

  • Enter 60248 for the Tuesday class, or 
  • Enter 60249 for the Thursday class.
Both classes run from 6:30-8:30pm, and start the week of April 17th.

Well, that should get you started. Feel free to post any questions you have in the Ottawa Ruby Google Group and we’ll try and help.

Onward!