Articles

SQlite3-Ruby Windows Builds

So, I’ve got a new sqlite3-ruby release pending (just a minor bug fix, is all), but I’ve learned my lesson about releasing a new version without a windows version pre-built.

The problem is, I’m not a Windows guy. My build environment for Windows is cobbled together and painful to use, when it works at all. I’ve decided that I won’t put myself through that pain anymore.

If you are a developer on Windows, and you have a sqlite3 build environment, and would be willing to compile the sqlite3-ruby extension for me, please do the following:

Red and Yellow And...

One of my last projects required me to spend a ridiculous amount of time categorising images into groups of colour. What a pain in the gluteus maximus.

Emacs? Emacs.

And with my handheld portable all-purpose lightweight doohickey I fuse thoughts and try not to be too picky. —Buck65

I’m personally offended that you enjoy the software you work with ;)—al3x

Update: Full 60-minute screencast now available at PeepCode!

Rails Database Connection with Block

I found myself needing to very quickly connect to an alternate database that was defined in my database.yml like so:

alternate_data:
    adapter: mysql
    database: alternate_database
    username: user
    password: pass
    host: localhost

I was accessing it with something similar to the following:

...And So Our Journey Begins!

It is with great pleasure and humility that I present to you, my new writings. I have decided to focus more on my real name and less on my dreamt up internet persona. Greetings everyone, for I am Jamie van Dyke a.k.a. fearoffish.

I have a new beginning. A new venture.

Testing views in RSpec with namespaced elements

We’ve been working on a Facebook app (yeah, I know, I’m sorry) and have had all kinds of fun challenges. We wanted to test FBML tags in the view, but the problem is that FBML uses namespaced elements.

Rails Caching: Dynamic Fragments

I am finally getting around to implementing caching on my Rails application that I’ve been working on adamantly for the past couple of months.  For the time being, I am using a memcached server with simple action and page caching.  I ran into a few problems with my first few attempts at fragment caching and decided it wasn’t really necessary for the time being.  I needed a simple method of including small sections of dynamic code in an otherwise static page.  I then wanted to use action caching on the resulting view.  I’ll outline a simple method I used to achieve this.

Rails templates

So now that Edge Rails got templates ( Thanks to Jeremy ) I just wanted to give a top level overview.

Templates are simple ruby files containing DSL for adding plugins/gems/initializers etc. to your freshly created Rails project. To apply the template, you need to provide rails generator with location of the template you wish to apply, using -m option :

Merging bug fixes

Greetings! I’ve been doing some maintenance work on Mephisto. The current development version now supports Ruby 1.8.7 and Rails 2.0.5. The unit tests all pass, and model_stubbing has been ripped out and replaced with machinist. I want to thank Rick Olson, Sven Fuchs and Peter Suschlik for all their help.

There are several things that we should probably do before making a Mephisto 0.8.1 release:

rejoice! rg is now part of rails

Just over a month ago, I posted a project named rg to my Github account.  It allows you to apply programmatic templates to your Rails applications so you can avoid all that monotonous setup every time you start a new app and avoid keeping it in Git where it tends to SCM rot.

Feed items | Rails Fire

Feed items

Railscasts Xcode theme

For those of you who use the excellent Railscasts TextMate theme and want to replicate the theme in Xcode, you can grab my version from Github. This is what it looks like:

Setting up virtualization on Ubuntu with KVM

These instructions have been tested on Ubuntu 9.10 (Karmic) 64-bit. Skip right to the instructions if you’re short on time.

Stop and Reload buttons merged in Firefox

A minor UI improvement to Firefox has been made to Firefox and it’s currently only available on nightly builds of Firefox: the Stop and Reload buttons have been merged into a single button. This change should make it into Firefox 3.6.

Firefox quick tip: view images in a new tab quickly

A mini-tip on viewing images quickly in a new tab in Firefox. Useful for web devs who want to look at the URL of an image quickly.

As an example, here’s the Youtube webpage of the owner of Maru the Cat:

ff3-middle-click-step-1

How my simple iPhone app made it to the top of the App Store

Slightly more than a month back I wrote this little iPhone app (App Store link), almost a toy app really, to check the usage of my data plan with my local telco (Singtel). I wanted to scratch an itch and I also really didn’t want to exceed my data plan – the fees are excessive.

Blog redesigned

After 5 long years of using the same old blog theme, which I’d handcrafted from scratch way back in 2004, I’ve finally got down to refreshing it to a more contemporary look. I’ve also updated the woefully outdated About page.

Here’s a before and after shot:

Blog theme - before and after

Upgraded to iPhone OS 3.0 and running out of battery fast?

After upgrading my girlfriend’s iPhone 3G to OS 3.0 recently, I noticed that the iPhone’s battery was getting depleted really quickly. I’d left it overnight with Wifi, 3G, Bluetooth, Push Notifications all off, and the battery went from 80% to a jaw-dropping OMGWTFBBQ 10%.

I attributed it to the recent jailbreak (I’ve already removed the jailbreak trying to figure out this problem) at first. I only realized something was really wrong when the iPhone’s battery started draining while it was charging via USB!

A curl-ier Curb – better cookie support in Curb

As of Curb 0.3.7, Curb comes with slightly better cookie support that makes it more “curl-like”.

It probably sounds like shameless self-promotion that I’m blogging about these changes since I’d contributed them. Well, yeah that’s true, but I’m also doing so because I doubt these changes will ever be made known since Curb doesn’t publicize any updates or changelogs.

Curb is my current number 1 HTTP client for Ruby so the more love it gets, the better.

Don’t kill your app when using ActiveRecord in Rails Metal, release your database connections

Rails Metal has been available on Rails since version 2.3 – it’s old news. But if you haven’t used it or heard about it, you can find out more about Rails Metal on the RoR weblog and on Jesse Newland’s blog.

I’m still alive, and on FriendFeed and Twitter

Wow, it seems like I haven’t posted anything this year. Don’t worry, you aren’t rid of me yet. I’m still alive and posting updates to FriendFeed and (less often) to Twitter.

If you belong to what I imagine must be now the microscopic population of loyal readers of my blog, please do hook up with me on FriendFeed or Twitter. I’ll follow you back if you’re a reader!