« March 2006 | Main | May 2006 »

Selective Fixture Loading in Rails

Apr 27 by Andre in Ruby on Rails »
Selective Fixture loading is exactly what it sounds like: load in a subset of your fixtures rather than the whole enchilada. I have found this to be absolutely essential. The syntax is:  rake db:fixtures:load FIXTURES=neighborhoods,stores

While I'm on fixtures - dump your existing data to a fixture or a file: http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml-reference-data

Google Sketchup goodness

Apr 27 by Andre in Google » , Web »
Google's free version of the sketchup 3D modeling tool includes two awesome features:
  • the warehouse, an online repository of 3D models of any scale, which are downloadable and reusable by anyone. And anyone can upload to the warehouse as well. There's a great example in the video below of a user who uploads a gate, and someone using the gate model in their house.
  • Google Earth integration -- anyone can "find their house in Google Earth, import the aerial photo and terrain into SketchUp, model their house (or apartment, or whatever), and send it back to Google Earth —for free".
Furthermore, everything can be tagged to a real-world location:
Models shared in the 3D Warehouse will even be able to be geo-referenced, meaning that they'll "know" where they belong in the world. When you submit your models to the warehouse, you'll have the option of including geo-referencing information
Watch the video, you will be impressed: http://download.sketchup.com/downloads/training/tutorials50/The_Story/The_Story.html

Lightbox for modal dialogs

Apr 25 by Andre in Javascript » , Misc » , Web » , jQuery »
I'm working on a project which incorporates some AJAXy modal-dialog-like popups. Which prompted me to look into the lightbox-type projects there that would fit the bill. These are the three main projects I found:

Continue reading "Lightbox for modal dialogs" »

Six key JavaScript techniques

Apr 20 by Andre in Javascript » , Web »

These are six techniques I have found to be invaluable in my JavaScript/AJAX development. If you are using library like Prototype.js, these techniques will help you better understand what's going on behind the scenes. On the other hand, if you don't want to use one of the pre-baked JS libraries (for example because you are building a very lightweight page, and don't want to incur Prototype's 50K download), then these techniques provide a very lightweight toolkit to make your JS coding more efficient.

Continue reading "Six key JavaScript techniques" »

Rails, Geocoding, and Google Maps

Apr 18 by Andre in GeoKit » , Google Maps » , How-to » , Ruby on Rails »
Update April '07: GeoKit, my Rails Geocoding plugin, abstracts away all the geocoding logic for multiple providers (Google, Yahoo Geocoder.us, Geocoder.ca -- including failover!), distance-based finders for ActiveRecord, and much more!
This is a simple example to demonstrate how to display a Google Map using Ruby on Rails, including utilizing a geocoding web service to translate addresses to geocodes.

Why the lookup web service? The Google Maps API doesn't just let you map an address. You need to supply the Maps API with a longitude and latitude to place a marker on a map (or even to center a map on a city). The geocoding web service translates a valid address into longitude and latitude; you can pass the result to the Maps API.

Continue reading "Rails, Geocoding, and Google Maps" »

Lots of Ruby power in a small package

Apr 14 by Andre in Ruby on Rails »
I came across these Ruby one-liners by David P. Thomas. Very cool -- I respect the brevity and utility. Finding things like this make me like Ruby (with or without the rails part) even more.

Craigslist "for sale" Google toolbar button

Apr 12 by Andre in Google » , Web »
Do you live in San Francisco? Use Craigslist.org a lot? Why don't you have a Google toolbar button to take out the drudgery of actually going to the craigslist site?

This button can save you SEVERAL MOUSE CLICKS each time you look on craigslist for something to buy! What the hell are you waiting for?! Download it!

Continue reading "Craigslist "for sale" Google toolbar button" »

$10K/page for corporate sites

Apr 12 by Andre in Web »
This has been dugg so you may already have read it. What caught my eye was the statement:
If many businesses approached space planning the way that they approached web sites their staff would be sitting on milk crates in an unheated concrete room and sales people would meet with customers at the Greyhound Station.
I agree, a good corporate site is an integral part of your business and your messaging, and it is a key touchpoint for your brand. Does such a thing really take $10,000/page? And if it really does in practice, does it have to be that way?

 http://christacy.blogspot.com/2006/03/10000-is-magic-number.html

Automated backup using Amazon S3?

Apr 09 by Andre in Ruby on Rails » , Web 2.0 »
A really nice application for Amazon's S3 would be a scheduled backup service. As long as I'm wishing someone would write this, here's my feature wish-list:
  • Select multiple folders to backup
  • Only backup changed files (since you pay for bandwidth)
  • Specify conditionals and/or regex's for the files you want backed up
  • Runs in the background; only alerts me if it wasn't able to complete a scheduled backup
  • Local encryption before sending it to the S3 servers
There are some interesting problems to solve here -- for example, since the backup takes time to complete, how can you ensure consistency of the backup set? Maybe you could take a local snapshot, and transmit to the S3 web service from the local cache.

On a related note, I came across an effort by Elliot Smith to build a Rails front-end to S3. Still in the proof-of-concept stage, but something to keep an eye on.