December 30th, 2009

Echowaves Notifier for OSX Beta Release

echowaves_icon.png

Today I’m making publicly available the first beta version of my new Echowaves Notofier for OS X.

The Echowaves Notifier is a simple OS X status bar application that will provide updates for when you have new messages in any conversations you follow on Echowaves.com.

The app is pretty simple at this point, but the core functionality works and I’m hoping to get some people to test it out. Next up is adding growl support and some user preference options.

The source code is available on github.com and the application is released under the MIT License so feel free to hack away on it if you like. If you do, please submit back any modifications so they can be included back into the “official” release.

August 5th, 2009

Cerberus 0.7 Released

This morning I released version 0.7 of the Cerberus continuous integration gem.

The gem (and zip and tarballs) are all available now via RubyForge.

Thanks to all who had a part in this release. Paul Hinze added bazaar
SCM support. Joe Van Dyk did some general code cleanup and Git SCM
updates.

So, grab the new version and kick the tires with it. Get the word out.

I’d really like to see Cerberus get some more usage and to see it grow
into a really mature, lightweight tool in the coming months.

Here is the changelog details for version 0.7

== Version 0.7
New config options, Bazaar SCM support, removed GMailer bugfixes

* added support for bazaar scm
* fixed bug with ActionMailer 2.3.3
* removed GMailer library. Use default Mail publisher instead
* added ‘build_dir’ option for setting custom build directory
* added ’setup_script’ option for a custom script to be run before build command
* Projects using the Git SCM were not getting the full diff output in
their Publishers

June 10th, 2009

Disable spindump on OS X to prevent system slowdowns

Every notice how slow and sluggish your OS X Leopard system can be after an application crash?

This is probably because of the spindump utility that OS X launches to create crash and “hang” reports located in /Library/Logs/HangReporter.

This is all fine and good, but spindump has an annoying habit of thrashing your system disk and eating up a sizable chunk of RAM. Personally, the MAJOR annoyance isn’t worth the aggravation just to get a useless “hang” report like the following.

Date/Time:      2008-07-09 16:33:26 -0400
OS Version:     10.5.4 (Build 9E17)
Architecture:   i386
Report Version: 4

Command:        Skitch
Path:           /Applications/Skitch.app/Contents/MacOS/Skitch
Version:        1.0b6.2 (1.0b6.2 (v10678))
Parent:         launchd [107]

PID:            377
Event:          hang
Time:           7.75s
Steps:          1

I’m sure there are many ways to disable this utility, but here is a quick an easy method I used to prevent the “sluggishness” after an app crash

sudo -i
cd /usr/sbin
mv spindump spindump.disabled
ln -s /usr/bin/true /usr/sbin/spindump

Problem solved!

May 30th, 2009

How to integrate punBB into an existing Ruby on Rails application

I released launched a rails side project, XBoxMMA.com, and one of the most requested features by the initial users was the addition of forums to the site.

Thinking it over, I clearly had two options: 1) code my own custom forum system for the site, or 2) use an existing forum system.

While I don’t mind coding forums for the site, I really didn’t want to set aside the time needed for coding when I could have been working on plenty of other projects. So, I set out researching existing forum software that I could utilize.

In searching for a third-party forum system, I really only had one major requirement – users needed to be able to login to the main website and be authenticated at the same time on the forums. I didn’t want my users to have to maintain separate accounts and separate logins for the forums and the main website. If I did, there would be no need for this tutorial as implementing standalone forums is a basic task.

Keep reading →

May 28th, 2009

Rails IE Bug with Excel Mime Types

Came across a pretty interesting issue this week while trying to do some bugfixes for a project in IE6 and IE7.

The Rails project has one action that accepts an *.xls format to deliver an excel spreadsheet to the user. Getting this to work is very simple, but for the sake of explanation here is the process.

Simply register the mime type in an initializer file

# config/initializers/mime_types.rb
Mime::Type.register "application/vnd.ms-excel", :xls

Then in your controller actions respond_to block you can simply reference the new format:

# app/controllers/my_controller.rb
def my_action
  ...
  respond_to do |format|
    format.xls { send_file ... }
  end
end

Now, back to the “bug” or issue with IE6 and IE7. Every time a user hit that specific action with a regular request (not requesting the *.xls format), they received both the expected HTML output AND the xls format output.

Naturally, I don’t want to bombard the user when an IE popup boxing asking them to download and Excel file when they aren’t requesting it.

A quick trip to Google turned up this old Rails ticket. The issue appears to be with how IE6 and IE7 set their HTTP_ACCEPT headers:

image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, */*

There are two easy work-around solutions.

First, you can manually check and set the format param for IE requests:

before_filter :hijack_ie_default_format

def hijack_ie_default_format
  if request.user_agent =~ /MSIE/ and params['format'].nil?
    params['format'] = 'html'
  end
end

However, be careful when doing this. If your action can also accept AJAX ( text/javascript ) requests, then this will override that as well and set the format to return as HTML which is obviously not what you want. You would then end up spending a few hours wondering why IE6 and IE7 where returning javascript “Syntax Errors” on your AJAX actions.

What I ended up doing, since I needed that specific action to respond to javascript requests as well, was to simply extract the excel request into its own action. Sure this may be overkill and not very DRY, but it is still a proper solution. I just created a new #excel_export action and updated my excel links to point to the new action.