Author Archives: billz

jQuery smart multiple DIV replace with LiveQuery

Here’s a nice little trick that should match class=^loadIntoDiv(.*) and load the result of the link into the div with the id matching what’s in the (.*) when clicked. Notice it uses the Live Query Plugin. $(function () { $("[class^=loadIntoDiv] … Continue reading

Posted in General | Tagged | Leave a comment

Using JQuery with Rails

There are a number of blogs out there which talk about using JQuery with Rails.  There are many more which don’t seem to quite get the unobtrusive nature of jQuery. I’d recently started along the path of using only jQuery … Continue reading

Posted in General | Tagged , , | 1 Comment

Maui

Leaving on a jet plane this morning to go to Maui for Chris’s wedding. Should be an awesome time!

Posted in General | Tagged , | Leave a comment

Back to WordPress

This software is just awesome. Typo was fun because it was RoR, but this is so much more slick. Wow what a pain it was to switch back tho. I had to Dump the SQLite DB, fix up the dump … Continue reading

Posted in General | Tagged , , | Leave a comment

The Dune Series

I’ve been on a sci-fi kick recently (the last year or so). Last year I started with A Stranger in a Strange Land (Complete Version) by Robert A. Heinlein. It was really out there, but had a definite profound impact … Continue reading

Posted in General | Tagged , , | Leave a comment

CA DMV

I’ve been living in my current appartment for about three years. When I moved here, I called the DMV regarding updating the address on my license. The first person I got on the phone told me that they don’t send … Continue reading

Posted in General | Tagged , , | 2 Comments

Ruby sort by descending domain

Here’s a fun and simple way to sort an ActiveRecord of domain names by subdomain, then domain. ie. server1.billzajac.com server1.blog.billzajac.com server2.blog.billzajac.com server1.williamzajac.com Here’s what I came up with for rails: def create_servernameslist find_servernames = Server.find(:all).sort_by {|a| a.name.split(/./).reverse.each {}} @sorted_servernames = … Continue reading

Posted in General | Tagged , , | 1 Comment

ActiveResource and Basic HTTP Auth

Rails 2.0 is pushing Basic HTTP Auth. This is a great simple way to add auth to your app. But with ActiveResource 2.0.2, you define your site argument with your username and password in your URI. But… If the password … Continue reading

Posted in General | Tagged , , | Leave a comment

Making ActiveResource find work with your controller

By default, ActiveResource find wants to search your controllers with query string params. For example: Person.find(:all, :params => { :title => "CEO" }) Would hit the URL: /people?title=CEO To make this work, you’ll need to add something like the following … Continue reading

Posted in General | Tagged , , | 3 Comments

Using xml with the resource_controller plugin

If you’re using an ActiveResource client to access your Rails controller which is using the awesome resource_controller plugin RESTfully you’re going to need to enable xml respsonses (which aren’t enabled by default with the plugin). class ProductsController < ResourceController::Base # … Continue reading

Posted in General | Tagged , , , , , | 2 Comments