As you may or may not be aware digital:pardoe has, for the past 4 years, been running atop a custom blogging engine that I developed as way to learn Ruby on Rails. Whilst the system has (nearly) always been stable and (nearly) always fast I felt it was time to retire it, from everyday use at least.
When using the digital:pardoe blogging engine the ‘blogging’ always felt secondary to the actual development of the blog, I was always found myself doing far more of the ‘adding new features’ than the ‘adding new posts’ which, at least in recent months, is not what I intended to happen.
Unfortunately, the loss of my bespoke blogging engine also means a loss of some of the bespoke features I added to the website. The downloads (previously ‘software’) area is now very cut down – everything is still available as before though. The ‘photo’ section has now disappeared completely, if you want to see my photographs you’ll have to visit my Flickr account instead. I’ve made every effort to redirect old pages to their new location but if you find a page that is missing please contact me so I can fix the problem.
In the near future I intend to release the digital:pardoe blogging engine source code (once I’ve cleaned it up of course) as it may be a useful reference to other new RoR developers. Don’t expect the default Typo theme to stick around for long either, I’m currently in the process of porting a digital:pardoe theme to Typo.
And, if you hadn’t guessed already, digital:pardoe is now Typo powered.
Check back soon.
Published by digitalpardoe on Tuesday 23 February 2010 at 01:00 PM
A friend reminded me of how nice it would be to merge all the windows in Safari back together using LaunchBar (or QuickSilver for that matter). So I wrote a quick AppleScript to accomplish the task;
The ‘gui_scripting_status()’ routine is taken and modified from code that can be found here: http://www.macosxautomation.com/applescript/uiscripting/index.html.
Check back soon.
Published by digitalpardoe on Wednesday 2 December 2009 at 01:30 PM
I’ve finally gotten round to updating iSyncIt and Set Icon for Snow Leopard, as always you can download iSyncIt here and Set Icon here.
The new release of iSyncIt fixes the only bug I could find under Snow Leopard – the icon not changing correctly under bluetooth on / off conditions.
The Set Icon release fixes the problem of the application not performing its one and only function – setting a drive icon. Along with the bug fix I modified the image conversion to prevent the (frankly awful) stretching of non-square images to fill a 512×512 icon, images now scale nicely. I also removed the terrible tool-tips that show up when you start the application I used to think they were ‘cool’ but soon realised the error of my ways. However, in place of this I added some ‘brilliant’ window resizing when you remove an icon – we’ll see how long that lasts. Oh, the application will also run as a 64 bit application now – not that that makes any difference what-so-ever, I just did it because I could.
Check back soon.
Published by digitalpardoe on Thursday 10 September 2009 at 10:28 AM

A while ago I started setting up my websites to use ActiveRecord as a session store, this means that the session information for all the visitors to my website is placed in a table in my database. It may or may not be the best way to store sessions but it’s certainly faster than the filesystem and my VPS doesn’t really have the memory capacity for an ‘in memory’ store.
Anyway, one day I decided to perform some DB maintenance, check tables where okay etc, upon logging into the DB I noticed that my sessions table had grown quite large, almost 125,000 records, little did I realize that the sessions are persisted forever in the DB.
I didn’t think it was the best idea to keep all the session data so wrote the following script and put it in ‘lib/tasks/session.rake’;
This gave me a ‘session:prune’ rake task. The task removes all sessions older than 1 day from the sessions table. I then added a CRON job for in the following format;
The job above basically calls the ‘session:prune’ rake task at midnight every night.
The code in the task in MySQL specific but without a model representing the session table I couldn’t (or at least couldn’t think of a way) to make the code any more ruby-fied. In the event that you do have, or decide to create a session model the following code may work in your task (warning: untested);
Hope the above snippet solves at least one of your ActiveRecord session woes.
Check back soon.
Published by digitalpardoe on Sunday 3 May 2009 at 06:31 PM

Assuming you’ve followed the Caching Your Photographs tutorial at some point, you’ll probably have had a lot of fun either deleting the cache every time you upload a new photo or you’ve written your own automated method by now. For those of you that haven’t written your own method of dumping the cache yet, here’s how I do it.
First of all, I created a ‘lib/actions’ folder in the root of my rails project. Inside this folder I created the file ‘photography_action.rb’ with the following contents;
The above fragment naming assumes that your photos are on a page called ‘photography’ if they are elsewhere, change the fragment to expire that page instead.
Fairly simple I think you’ll agree, you may also be asking yourself ‘why the extra file?’, the main reason for the new file is so that the cache clearing can be executed from a new rake task that doesn’t remove all your cached pages or from an admin page on the website.
You’ll also need to update your ‘config.load_paths’ in ‘environment.rb’. After updating, mine looks like this;
Inside some action in some, preferably protected, controller somewhere, add the following (redirecting to anywhere you fancy);
Now for the rake task. Inside the directory ‘lib/tasks’ (create it if it doesn’t exists) create the file ‘photography.rake’ then put the following code inside the file;
You should then be able to run;
From the base of your project in order to clear the cache.
Bear in mind, the code above is literally just a convenient way of clearing out the fragment cache so new photos show up on your photo page, it does not delete photos, nor does it perform a refresh automatically, although, you could add it to a CRON job.
When I get chance, I intend to automate this process and build it into rFlickr along with a new, improved, caching mechanism. I’m sure the above will tide you over for now though.
Check back soon.
Published by digitalpardoe on Sunday 3 May 2009 at 05:50 PM