Articles

Improving Rails Applications performance

I have done some research about improving Rails Applications performance. I would feel the the following few points need to be considered when we optimize rails applications for performance:

1) Avoid the use of dynamic URL generation (link_to, url_for) since rails needs to look up the routes table and that may take time. Just hard code the controller name and the action.

2) Try to avoid the excess use of helpers since it adds overhead.

sharing your changes

Git’s distributed nature does not rely on central servers to host and broadcast your code. There’s more options available to you if for some reason your main server goes down, or perhaps when GitHub goes down.

alternative Block execution on empty Enumerable

i did not find an easy way to specify an alternative action when an iterator had nothing to iterate over.

My first try was

New Managed Hosting Plans

After months of research, planning and development, we’re proud to announce the Rails Machine Managed Hosting plans, starting at $275/month. You can now get direct access to the same team of engineers and developers who have brought you reliable hosting for your Rails applications since 2006.

bash git status

Yeah, we all know about the git status command but that’s just way too many characters to type again and again. Why bother with those 10 keyboard strokes when you could have your shell simply output git’s working state? Sounds awesome, right? Luckily a few hackers have thrown together some scripts to do just this in your bash prompt. If you have these or similiar scripts working in other shells, submit a tip about it!

Announcing Golden Gate Ruby Conference

This has been a long time coming, and I'm very happy to finally be able to announce the first ever Golden Gate Ruby Conference, here in San Francisco on April 17 and 18. There's so much interest in Ruby here in SF, and tons of Ruby mojo too, so it's about time we had our own conference! We'll be bringing in some great speakers from all over so locals who don't get to travel to conferences can get exposed to stuff they can't usually see. And we'll also have some of our high-powered local talent showing off their stuff too.

Announcing Golden Gate Ruby Conference

This has been a long time coming, and I'm very happy to finally be able to announce the first ever Golden Gate Ruby Conference, here in San Francisco on April 17 and 18. There's so much interest in Ruby here in SF, and tons of Ruby mojo too, so it's about time we had our own conference! We'll be bringing in some great speakers from all over so locals who don't get to travel to conferences can get exposed to stuff they can't usually see. And we'll also have some of our high-powered local talent showing off their stuff too.

Do You Test Your Views?

Those of you following me on twitter already know that I’m learning Cucumber.

Traditionally I don’t test my views or controllers all that much. I know, I know, it’s heresy. But I’ve just never gotten much value from writing Rails functional tests nor integration tests.

Let browsers cache static files to greatly speed up your site

There are many factors that determine how long a page takes to show up in a browser. When a page is requested by a browser, the server needs some time to compute the page contents (controller, model/database, view) and returns HTML to the browser.

tip for writing better web app copy

Bad copy is hard to detect, but it makes a big difference in the clarity of an interface or the success of a sell.

Most of the copy in my apps is written once, found sufficient, then ignored. The hard part comes when I decide to rewrite. Since I can’t unit test writing, the options of different verbs or phrases to type gets overwhelming.

Jason Fried wrote an article yesterday on this w/r/t writing copy for highrise that I want to elaborate on.

He says:

Articles | Rails Fire

Articles

Uniq for Array or Hash with a Deeply Nested Structure

Most people have had some experience with ruby’s built in #uniq method for Arrays. Internally, this method finds the unique items in the array by creating a hash internally, and this internal comparison is done with the #eql? method. If an item in the array is a Hash, then #eql? simply uses the object_id, generated by the #hash method, to determine whether it is equal to another object in the array. There are many solutions online each with s light variations and goals.

reboot

My blog had been running on an ancient web host account for years without incident, when one day, my mongrels collapsed. However, I was extremely busy, and even a little apathetic towards the site. The holiday break gave me a chance to move it the content over to a modern install of Mephisto. If you’re actually visiting the site, you’ll notice I even barreled through a new CSS setup with Blueprint as my wingman. However, I’m still missing some things:

is LOST on yet?

I needed to know, so I wrote one of those trendy single page apps: is LOST on yet?. Naturally, the source is on github. It’s really pretty amazing actually:

def is_lost_on_yet?
  @is_lost_on_yet ||= {:answer => "no", :reason => "returns on Jan 21st, 9PM ET"}
end

I have about 20 days to finish the site :)

Update: I forgot to mention, it even has JSON support!

Blog focus

I'm going to change the focus of this blog. Not that it ever really had much focus before, but it was called 'Rails Tales' and my plan was to talk about developing applications with Ruby on Rails. But lately, at Entertonement (where I'm a web developer), I've been more interested on understanding our users and decreasing bounce rate. This has revealed some interesting things that I want to

Integrating Mint and Mephisto

John Nunemaker, top ruby blogger of 2008, just posted about RailsTips.org’s awesomely expanded footer. If you click through to the full post, you’ll see his custom plugin pulling the most popular articles from his Mint stats.

Welcome to the New Site

I’ve maintained a blog since sometime in May of 2005. As with many blogs, posting regularity varied. Sometimes it was daily, sometimes a month or two would go by with nothing new at all.

This is something different.

The content on the old site changed over time, just like it’s author. Interests come and go, technologies that were once shiny and new have lost some of their shine. I stopped writing short posts that were mostly links to other people’s content, and starting writing longer articles. I did some interviews, and a bunch of book reviews.

Refreshed, realigned and ready for 2009

It was over 2.5 years ago I did anything major to toolmantim.com. For the last 2.4 years I’ve wanted to redesign it and the past 1.5 years I’ve wanted to re-code it.

Wrapping a Method in Ruby

Let’s say you have a Ruby class with a method you’d like to wrap—for debugging or performance timing—and, since you don’t control where the class is instantiated (think overriding a method in Rails’ ActionPack), just creating a subclass and using super isn’t going to work.

Let’s take a look at two mixin patterns; one a ubiquitous naming hack and one a bit of esoteric Ruby inheritance trickery.

First, let’s set the scene. Let’s say we have a method, Widget#render_on:

router plugin released, hacking, and magic

Today I (finally) released my Rails router implementation as a plugin named krauter (all apologies to any German citizen who may be offended!  I didn't mean to be a racis– er...nationalist?).   Take a look at the code over at my Github account: http://github.com/jeremymcanally/krauter

I'm also hacking on a few other projects you should be looking for soon if you're interested...

Rspec domination

Wycats is pushing this poll everywhere. As of Jan 02, RSpec is dominating at 53%

Wonder if this means anything for the future of the Rails default test framework…?

Ruby5: A Twice-Weekly 5 Minute Ruby News Podcast | Rails Fire

Ruby5: A Twice-Weekly 5 Minute Ruby News Podcast

ruby5-itunes-logo.pngRuby5 is a new twice weekly podcast dedicated to Ruby and Rails news. It's headed by Gregg Pollack (formerly of the RailsEnvy podcast which Jason Seifer has now taken over) and Nathan Bibler. They aim to cover several bits of Ruby and Rails news in five minutes. You can also leave comments about the stories on their site as you listen. As of today, there are 7 episodes in the archives if you want to catch up, all in the 5-6 minute range.

I'm not a big fan of listening to news, but Ruby5 has done a great job of also making it possible to learn about what they've featured without listening to the audio if you don't want to.

Images: