I am available for freelance work! Click here to email me.

Archive for the 'Ruby on Rails' Category

« Previous Entries Next Page »

Fixing Long Key Lengths in MySQL

Thursday, June 17th, 2010

While using Query Reviewer, I occasionally come across a warning along the lines of the following:
2 identical queries Table videos: Long key length (768)
With the following explanation:
The key used for the index was rather long, potentially affecting indices in memory
To fix this we need to limit the length of our index. We can do this [...]

Posted in Ruby on Rails | Tags: , , , | Comments

Calculating an Images Orientation using Paperclip

Thursday, June 10th, 2010

If you ever need to know if an image is portrait or landscape in orientation, you can do the following (assuming you have an orientation attribute on your model:
class Image < ActiveRecord::Base
# Paperclip
has_attached_file :file

# Callbacks
before_create :set_orientation

protected

def set_orientation
original_file = self.file.to_file(:original)
[...]

Posted in Ruby on Rails | Tags: , , | Comments

How To Speed Up Textmate in Large Projects

Thursday, March 25th, 2010

You know those times when Textmate beachballs for about 5 seconds when it regains focus, it’s generally caused by the fact you’ve got about 16 million folders in your public/system folder used by paperclip.
Here’s a quick tip to speed things up by ignoring those folders:
Open Textmate Preferences and goto the Advanced section. Then click on [...]

Posted in Ruby on Rails | Tags: , | Comments

« Previous Entries Next Page »

Purify - Issue Tracker

Jim Neath is a 26 year old Freelance Ruby on Rails developer from Manchester, UK.

Recommend Me

You are currently browsing the archives for the Ruby on Rails category.

Categories