June 2011
3 posts
6 tags
Wrong way, Right way - Part 3 - Avoid unnecessary...
Note: I’ve been using this technique for a while that I’d forgotten I was doing it. Thumbs up to CollectiveIdea for their post which reminded me and inspired the following. Part of a series about common Ruby mistakes that make things slower or are just plain wrong. Not the style of the code (indentation, methods names etc), but the actual code itself. All examples use Ruby 1.9.2 and...
Jun 29th
3 notes
6 tags
Wrong way, Right way - Part 2 - Work with eager...
Part of a series about common Ruby mistakes that make things slower or are just plain wrong. Not the style of the code (indentation, methods names etc), but the actual code itself. All examples use Ruby 1.9.2 and Rails 3.0.x. Part 2 - Work with eager loading, not against it The Wrong Way class Post < ActiveRecord::Base   def last_comment     comments.order(:position).last   end end...
Jun 12th
1 note
6 tags
Wrong way, Right way - Part 1 - Optimized...
Part of a series about common Ruby mistakes that make things slower or are just plain wrong. Not the style of the code (indentation, methods names etc), but the actual code itself. All examples use Ruby 1.9.2 and Rails 3.0.x. Part 1 - Optimized conditional data sections The Wrong Way @comments = Comment.order(:position) if @comments.count > 0   @comments.each do |comment|     …    ...
Jun 12th
December 2010
1 post
6 tags
Review: Gran Turismo 5
TL;DR: Scan the post for tips. They’re prefixed with ‘Tip:’, then read the Pros, Cons, Missing, and more Tips are the bottom. So I bought Gran Turismo 5 (GT5) a week ago, and I’ve been playing it with every free minute I can get. I’ve been a fan of the GT series since I bought GT3 back in 2003. So I’ve been waiting for GT5 for a while now. I bought the...
Dec 4th
October 2010
1 post
How fast can your browser run? - Take 2
TL:DR: Google Chrome has pulled ahead of Webkit in terms of JS speed and feature completeness, however, it hasn’t utilized the graphics card well enough on the Mac. It’s been nearly five months since I last did one of these. In that time, Chrome has gone from v6 to v8, Webkit has had close to 10,000 commits, and Minefield has gotten even closer to being released as Firefox 4. So I...
Oct 29th
3 notes
June 2010
1 post
4 tags
How fast can your browser run?
I wanted to see which browser has the latest and greatest in both rendering engine and javascript engine, so using three well known tests, I put the latest available browser versions for Mac to the test. What was tested? The following browsers were tested: Chromium 6.0.426.0 Minefield 20100604 Webkit r60724 Opera 10.54 build 8353 For those unaware, Chromium is the latest semi-stable version...
Jun 4th
3 notes
January 2010
1 post
4 tags
Migrating from Github to Gemcutter
( cross-posted from http://blog.katipo.co.nz ) For those of you who follow this sort of thing, Github shut down their gem building. Thankfully, a newer and easier gem hoster, Gemcutter, appeared on the scene not long before that happened. The idea behind it, for those who haven’t heard of it, is that you manage your own gem building. Gemcutter doesn’t wait for your Gem spec to change before...
Jan 20th
4 notes
October 2009
1 post
My Tools of the Trade
A bunch of these posts going around. Thought I’d chime in and list what using day to day. I’ve swapped a lot of software recently with what I consider better software. Not all of it is free. Same I bought on their own, others I got as part of a bundle (like MacHeist). There are free ones out there, but these are the ones I chose and work with. Hardware Computer 13” Macbook...
Oct 25th
July 2009
1 post
5 tags
Re-resizing images with attachment_fu
The application I work on (http://kete.net.nz) has an image sizes sysem setting that allows site administrators to changes the resized dimensions when someone uploads a photo. But we ran into case where someone drastically changes the dimensions after already adding several hundred photos. Can’t upload them all again! So we wrote a rake task. It goes through the image files table, getting...
Jul 5th
5 notes
May 2009
3 posts
7 tags
Getting Internet Explorer 8 on the Mac (or any...
While developing Kete, maintaining cross browser compatibility is a concern for us. We need to make sure that the site runs the same on Internet Explorer 6, Internet Explorer 7, Firefox 3, and Safari 4. As anyone who has tried can tell you, testing with Internet Explorer on a non Windows machine is not easy, but there is a way! The Mozilla developers do an excellent job at making Firefox...
May 7th
20 notes
May 7th
3 notes
May 7th
4 notes
April 2009
7 posts
1 tag
Spotlight, Quicksilver, or Google Desktop?
Lately I’ve been trying out various application launchers for my new Macbook. For a long time, I’ve used Spotlight, the Mac’s build in ‘searcher’. But after a bit of searching, I found two other contenders. Quicksilver and Google Desktop. But I’m wondering what other people use… perhaps there is a neat app that combines the arithmetic functions of...
Apr 12th
1 tag
Capistrano Configuration - My first gem
For my work, we needed an easy way of configuring sites per deployment, but didn’t want the hassle of multiple yml files to manage. We needed an easy to use ruby syntax that didn’t require much more than including the code and writing the configurations. So, we created…. Capistrano Configuration. I wrote the code in a lib file and decided to move it to a gem so that others...
Apr 12th
1 tag
Phusion Passenger and Ruby Enterprise Edition...
So I finally decided to donate to a project on the web, and I chose two to start with. Firstly, Phusion Passenger. They’ve done some awesome work, making Ruby on Rails websites much easier to deploy, and run with less memory. Secondly, Ruby Enterprise Edition. It’s made by the same people as Phusion Passenger. I’ve used it for some time too, and it’s much easier to install,...
Apr 12th
3 notes
1 tag
System Wide Capistrano Colorization
I recently discovered the handy little gem capistrano_colors. It adds color to your capistrano deployment, which makes it easier to spot where things went wrong. But the problem was that it required a change to the deploy.rb code, which meant that if you used it, everyone who deployed the code needed it to. What if you wanted it without adding the new dependancy for everyone? Well the first way...
Apr 12th
3 notes
1 tag
Unintuitive Ruby feature... or is it?
The fact that ruby variables reference objects was one of the first things I read about in the differences between PHP and Ruby, but over time, not having actually run into problems, recently this fact took me by surprise so I thought I’d share my thoughts. Take this code sample for example: » a1 = %w{ 1 2 3 } » a2 = a1 » a1 = %w{ 4 5 6 } » puts a1.inspect...
Apr 12th
1 tag
Search for the best Integration testing
When you make a Rails application, there are some things unit and functional tests just can’t test. Like if something actually works in practice, or if caching is working the way it should. If you don’t test these, you can get run into a lot of problems, especially if that code is an application installed in multiple places. And it can be a pain to make sure code you add works as...
Apr 12th
1 tag
Collection of helpful alias methods
There was a blog post recently by the guys/gals at Thoughtbot which showed several irb & script/console tips to make development easier. I’ve been using them, and the SQL in script/console alone is worth the few minutes of setup. But I went ahead and created some more alias’s in my .profile file, which I thought some of you might like or already have. They make development just a...
Apr 12th