Blogs and Stuff
Intellectual plumbing and 100% toll free.
Attachment_fu is a great plugin by Rick Olsen (a.k.a. techno-weenie). I use this plugin for one of the sites I maintain. I recently ran into a situation where I needed to regenerate the thumbnails for all the uploaded images. Attachment_fu provides no built-in support for this, so I had to get creative. A quick search on Google revealed a post by Michael D. Ivey that seemed like a reasonable thing to do, but was not sufficient by itself. So in this blog, I plan to cover the steps I took to automate the regeneration of thumbnails when you are using attachment_fu.
You ever have an old car that you refuse to relinquish because it continues to get 10 miles to the gallon and you've had so many memories with it? Sure, you've seen the commercials for those fancy cars that are more environment friendly, safer to drive, and have a built-in GPS, but you still refuse to surrender old "Eleanor" for some new technology. Until recently, I've been on that same bus only my car was Subversion. I've been using Subversion for the past two years as my Source Code Management (SCM) system of choice. Just recently, I spent over three hours dealing with a corrupt Subversion repository. This single event was the straw that broke the camel's back, in fact, it didn't just break the back, it smashed the camel into a little pancake. Therefore, I decided to 'Git' rid of Subversion and give Git a shot at the title.
Welcome to another edition of me talking about some website that's been kicking my butt for months on end. If you remember back in this blog, I was beginning to build a revamped version of my family's restaurant website. From what I can gather, and my timestamps seem to be telling the truth on this one, I broke ground on the new site approximately January 29, 2008. Had anyone been around me at the time, I'm sure they would have swiftly commented under their breath "Well, so much for his weekends for the next year". Luckily for me, that wasn't the case this time.
Until this week, I hadn't experimented much with the Google Maps API. Sure I was a heavy user of the web interface and the map integration built into the iPhone, but didn't tinker with the nitty gritty details yet. I decided that since I'm working on an updated version of the website for my parent's restaurant I may as well try something new. With much of the site well underway, one of the missing sections was the contact page. My thinking was that I could create your run of the mill contact page and then for people that aren't familiar with the area, well, let them enter their address and allow Google Maps to do the rest. Easier said than done as usual.
My apologies for not blogging in quite some time, ever since the new year I've been quite busy with several other projects. Most notably, leveraging Craigslist to get rid of some excess furniture, preparing for our upcoming Colorado ski trip, enjoying the sweet victory of the New York Giants winning the Super Bowl, and working on the design for a new version of a website for a restaurant. But fear not, I'm still alive and rocking some new Rails code with the help of my faithful Textmate and ever so creative Photoshop software.
When designing a web site, most of the work goes into making a well-designed and usable frontend interface. What doesn't get nearly as much love is the backend administrative interface. Like security, it typically comes as an after thought if at all. However, with this website, I needed a reasonably functional administration section that would allow me to manipulate data in the models and a somewhat presentable interface that wasn't so arcane that it was unusable. While I did write some custom code to manage certain aspects of the site, developing an entire administration section from scratch was about as palatable as a dish of warmed up horse droppings. Say hello to my new best friend, ActiveScaffold.
Over the weekend, Rails 2.0 was released to the masses. Packed with a flurry of changes, I decided to take the plunge. After grabbing a Coke, turning on some music, and firing up TextMate, it was time to rock and roll. One of the new features included in the release was RequestForgeryProtection, one that I wanted to take full advantage of to help protect against CSRF-based attacks. Considering I've been keeping current with each release cycle of Rails, I was hoping that the upgrade from 1.2.6 to 2.0 would be a piece of cake. Well, long story short, it wasn't. Not suprising I'm sure, but it was another late night of code wrangling that ended up putting me to bed around 5:20am on a Saturday morning.
It's been nine months since version 1.0 of the new site was originally launched back on New Years. Since that time a number of bug fixes and other improvements have been made based on feedback from users and the my general urge to write some Ruby code. When I began developing the new site, I knew little about Ruby and even less about Rails. Looking back through my 5,284 lines of production code and 11,330 lines of test code that currently make up the site's codebase, you can almost see a pattern of improvement in my Ruby kung-foo as time progressed. Had I to do it all over again, I'd probably make some significant changes to the underlying plumbing and would better utilize some DRY principles that I didn't fully understand when this all began. Do you see where I'm going with this? Yes, that's correct, the site is getting re-written from the ground up.
There are a few sections on the site that utilize what I might call a date picker. For instance, on the webcam page, you can select the date you would like to view and then click submit. Magically the images appear for the date you requested. Also, the music section allows you to view playlists for each day back since the creation of the site. Up until now, these were implemented through three separate drop down menus (month, day, year). Despite it being functional, there had to be a way to make it a little more user friendly.
For anyone that's recently visited the Apple website, you'll notice that they did a complete overhaul of the user interface. Apple must have some of the most talented design engineers on the face of the planet. I find their interface is sleek, well-organized, and actually somewhat fun to use. But this isn't a blog about them, it's a blog about the changes that I've made to the frontpage of the music section. Inspired by the new scrollbar widgetry that Apple has incorporated at the top of a variety of pages, I decided to embark on my own adventure to use this concept in a way that would make for a better user experience.

