
Parents’ new pup
Listen to music, look at photography, bicycling, or read ramblings below. Looking for something older? Browse all 293 posts.

Parents’ new pup
This is the best smoothie I’ve ever made and it’s really easy, granted you have a blender on hand.
I’m sure you will agree, it’s the best smoothie.

A week in France with my mom. We flew over the Atlantic — the plane had headrest monitors powered by Linux showing our position — then took a train through Barcelona to Cerbère on the French border. Loved it there. Little hostel right by the water.
From Cerbère we made our way inland to Caunes Minervois to stay with Steve and Marilyn: a wonderful little village with cobblestone streets, a 14th century house, and a Roman aqueduct. They were incredible hosts — cooked rabbit with a 2000 vintage opened at 9am, decanted at 5, served at 8. We also drank a 1996. Best wine I’ve ever had.
Day trips to Carcassonne’s La Cité: the church, stained glass on the ceiling, narrow streets, and views overlooking the city.
We also made it to Paris. The line for the Eiffel Tower elevator was long and it was rainy and cold, so we walked up instead.




When working with multiple models and forms in Rails, your associations need to
use build instead of new. I never knew there was a distinction between the
two. Apparently, I was wrong :\
For example, this will not work when trying to validate the associations:
@account = Account.new(params[:account])
@user = @account.users.new(params[:user])
The new method doesn’t actually build the association. The @account will be
saved, but the @user won’t be if it fails validation.
Using the build method will automatically take care of the transactional part
for us so the @account object won’t be saved until both models are valid:
@account = Account.new(params[:account])
@user = @account.users.build(params[:user])
It’s handy in the controller too. Instead of calling both @account.save and
@user.save, you simply call @account.save and it saves the @user
association.
consider_local "64.14.3.193/26", "64.41.168.241/28", "216.35.7.96/27", "64.41.140.96/27", "216.49.80.10/32", "165.193.42.64/26", "165.193.42.128/26", "203.82.140.96/28", "210.59.224.251/32", "210.61.79.253/32", "203.66.219.16/32", "85.92.223.0/26", "217.169.58.64/26"
Plop that below the inclusion of the ExceptionNotifiable module and you’ll never get pesky emails from McAfee’s ScanAlert barrage.
I just realized after seeing a post about Redcar (a programmer’s editor for GNOME) that I am uninterested in finding new editors. This used to be something I was desperate to find because I could never get vim to work right for me. I remember trying all kinds of editors like scream, BlueFish, and Kate. All never really sunk in with me.
Here’s a timeline of my use of text editors:
1. Notepad
2. EditPlus
3. Dreamweaver
4. VisualStudio
5. TextMate
6. Vim
I feel as though it’s an obligatory crescendo that all developers must play. The desire to find more powerful tools to help them with their daily tasks. It inevitably falls back to the basics. The tried and true editors that have been with us since the dawn of personal computing.
It does feel good knowing that I never will need to go find another editor ever again.



I needed a reusable way to do query parameter ordering. Currently in our admin section, we use clickable table headers to sort by ascending or descending. It looks something like this:
attr_encrypted is a dead-simple way to two-way encrypt information in your database. In our latest project, we are storing social security numbers, so obviously we needed an encryption solution.
I started off with EzCrypto because I had used it in the past. It worked fine, but I came across attr_encrypted and it seemed more elegant.
I had some problems getting it working, namely getting it included (or required) correctly. Before your class definition, simply put:
require 'attr\_encrypted'
and you should be good to go, considering you installed the gem.
Another, more elegant way of making sure the gem is required properly, set it as an environment option:
config.gem 'shuber-attr_encrypted', :version => '~>
1.0.8', :lib => 'attr_encrypted', :source => 'http://gems.github.com'
In our case, we have a Customer model. This Customer models needs to store encrypted social security numbers. When I first created the Customer migration, I assumed this column would be called ‘ssn’. I had troubles working with attr_encrypted because it has some conventions that I must have overlooked in the documentation.
In order to use it correctly, the column in the database needs to be named ’encrypted_ssn’. When you specify which column is to be encrypted with the attr_* method, you are essentially creating a virtual attribute that is used to encrypt/decrypt the actual data.
Hope this helps someone who is having similar problems.
One early morning at Bayfront Park. So ominous, yet so peaceful.