No Callbacks, No Threads & Ruby 1.9

7.26.10 by Gregg Pollack

A few weeks ago at Railsconf I approached Ilya Grigorik about recording his awesome talk in the same style that I captured John Athadye and Joe Damato’s talk. He recommended I grab him at OSCON to redo the talk as it would be a little more polished by then, so i did!

In the talk he discusses the state of the Ruby VM and why we should standardize an asynchronous Ruby stack which takes advantage of Ruby 1.9, Fibers, and non-blocking database drivers to make Ruby (and Rails) more scalable.

View on Viddler

Resources

OSCON Interview

7.23.10 by Gregg Pollack

This week Nate, Jacob, Thomas and I are at OSCON where we taught our Rails 3 tutorial on Tuesday. Yesterday at the conference I was interviewed in the OSCON booth, the results of which you can see below:

View on YouTube

Common Rails command shortcuts

7.15.10 by Jacob Swanner

I know many people — including myself — use Bash aliases for common command line tasks. Some popular examples would be: ss short for script/server, sc for script/console, and sg for script/generate.

These are setup by putting the following code in a Bash configuration file — such as ~/.bash_login:

alias ss='script/server'
alias sc='script/console'
alias sg='script/generate'

That works great, until you switch to Rails 3; all of these script files have been removed, and you use the rails command in their place: rails server instead of script/server, rails console instead of script/console, etc. Rails 3 provides shortcuts for the common commands: rails s is short for rails server, rails c is short for rails console, and so on. Some have suggested aliasing the rails command to just r, allowing you to use r s to start a server.

These shortcuts are nice, and is much less typing. But, I don’t want to have to remember when I’m in a Rails 2 app to use ss and then when I’m in a Rails 3 app to use r s; I want ss to just work in every project. Unfortunately, you cannot use a Bash alias to solve this problem; you can however use a Bash function! The following is a drop in replacement for the old alias ss=... stuff in your Bash configuration file:


function ss {
  if [ -e script/rails ]; then
    script/rails server $@
  else
    script/server $@
  fi
}
function sc {
  if [ -e script/rails ]; then
    script/rails console $@
  else
    script/console $@
  fi
}
function sg {
  if [ -e script/rails ]; then
    script/rails generate $@
  else
    script/generate $@
  fi
}

They work by checking for the existence of a script/rails file, which is new to Rails 3; if the file exists use it, otherwise fall back to using the Rails 2 version of the command; any arguments given to the function are passed along to the script, which is the $@ bit above.

I’ve contributed these changes to the Terminal project by Pigment, which includes similar shortcuts for many other common tasks.

LiveReload Screencast

7.11.10 by Gregg Pollack

Are you still hitting the refresh button every time you change some code / stylesheet?  If yes, you may want to watch the following video and learn about LiveReload by Mikhail Gusarov.

View on YouTube

Yes, I know there are already a few other tools out there that do this, but I don’t think I’ve seen any that actually reload the CSS or Javascript without even reloading the page.  I also forgot to mention in the video that it works in both Safari AND Chrome.

Ruby Tracker, the Ruby Dependency Manager

7.6.10 by Nathaniel Bibler

This morning on the Ruby5 podcast, we announced the release of Ruby Tracker. Ruby Tracker is our newest community support project which monitors and reports on library dependencies in your Ruby software and was primarily spearheaded by myself and Mr. Jacob Swanner.

“A dependency tracker… What the h*ll does that mean?”

Well, thanks for the unsolicited question, good sir. The simplest explanation is this: We examine your project repositories and determine what gems – specifically what versions of each gem – you use and then let you know when one of them is updated.

Read the rest of this entry »

Garbage Collection & the Ruby Heap

7.6.10 by Gregg Pollack

At Railsconf a few weeks ago I managed to get two of my favorite talks on video. Two weeks ago I published John Athayde’s talk on Beautiful Markup, and today I’m happy to publish Joe Damato’s talk on Garbage Collection & the Ruby Heap.  If you really want to learn how to finely tune your Ruby interpreter and find memory leaks, then you’ll want to pay close attention to his talk.  If you’re looking for additional information about Scaling Ruby, you may want to grab the EnvyCast I produced on the topic.

Read the rest of this entry »

Help Wanted

6.29.10 by Gregg Pollack

In case you missed the tweets, Envy Labs is looking to currently fill two positions, a Senior Graphic Designer and a Project Manager. If you know anyone who might be interested in the position please send them our way. Including me, Envy Labs currently employs 11 people! Damn!

I put together a short video to show people around the place, which I thought I’d share here:

View on YouTube

Beautiful Markup

6.21.10 by Gregg Pollack

One of the best talks at Railsconf was given by John Athayde on Curing Div-itis with Semantic Html, CSS, and Presenters. John was nice enough to redo his talk for me at the conference so I could properly capture it and share it with you. In his talk he goes through several techniques they employ at InfoEther to create beautiful markup in their web applications.

Read the rest of this entry »

Ruby Hero Awards 2010

6.12.10 by Gregg Pollack

This is the third year I ran the Ruby Hero Awards, and last Tuesday at Railsconf 2010 I gave away 6 more trophies to people in our community who deserved a little extra recognition. This year the awards went to José ValimNick QuarantoAaron PattersonWayne SeguinGregory Brown, and Xavier Noria.  Here’s a video of the award ceremony at Railsconf if you want to learn more about each of these guys and see how it went:

View on YouTube

Rails 3 Screencasts

6.8.10 by Gregg Pollack

This evening at Railsconf I announced the release of the Rails 3 screencasts I’ve been working on for the past few months.  Here at Railsconf Envy Labs ran a three hour Rails 3 tutorial (which received fantastic feedback).  These screencasts basically cover the same content we presented in the tutorial (without the labs).

There are six different videos which are all published on the official RubyOnRails.org website.  There’s a two minute Introduction video,  Getting Started & Action DispatchBundler & Action MailerActive Relation & Active Model,  Cross-site scripting & Unobtrusive JSThe New Action Controller.  Here’s the introduction video to get your appetite wet.