test Thursday, December 04

9 May 2008 | 11:06 | magnolia | No Comments

test Thursday, December 04
Internal Revenue Service

Source of all my funding.
Rating: ★ ★ ★ ★ ★
Tags: irs, foo
American Spoon Foods: Gourmet Food, Gift Baskets

Shop online at American Spoon Foods for our fine gourmet food, gourmet jams, jellies, preserves, salsas, condiments, gift baskets, sugar-free products, and authentic Gelato, Italian-style Ice Cream. Also browse through our gourmet […]



OpenId 2.0 and Ruby on Rails 2.0.2

6 March 2008 | 17:05 | openid, ruby, rubyonrails | No Comments

I just converted a website from the openid_consumer plugin to DHH’s open_id_authentication plugin and patched it for OpenId 2.0.
I found face’s port of Dr. Nic’s sample open_id_authentication app to be a useful starting point. I ended up chopping down the open_id_helpers class to this:
module OpenIdsHelper
# Pass optional :required and :optional keys to […]



Calling a rake task from rails code.

23 January 2008 | 13:52 | rake, ruby, rubyonrails | No Comments

1) Require rake and load the rake files containing the tasks and dependencies you want to run:
require ‘rake’
load File.dirname(__FILE__) + ‘/../vendor/rails/railties/lib/tasks/misc.rake’
load File.dirname(__FILE__) + ‘/../vendor/rails/railties/lib/tasks/databases.rake’
2) invoke the task
Rake::Task[”db:test:prepare”].invoke



delete and delete_all don’t trigger callbacks

10 January 2008 | 14:01 | rubyonrails | No Comments

I’m sure this isn’t earth shattering to anyone but I had forgotten about it and it caused me some head scratching yesterday.



Base classes get stored by ActiveRecord with type = NULL when using STI…

10 January 2008 | 13:53 | active record, rubyonrails | No Comments

So you make sure you take that into consideration when crafting find_by_sql queries on STI tables.
For example when looking for all but one type in the table:
AND ( g.type != ? OR g.type IS NULL )



sudo !!

4 January 2008 | 0:24 | linux | No Comments

I just discovered this handy linux command to repeat the last command from history as sudo:
sudo !!
I’m sure this is probably old news to most people.



Solr pure negatvie queries

20 December 2007 | 13:51 | solr | No Comments

Over at SolrQuerySyntax on the Solr wiki they claim that you can do pure negative searches ( i.e. searches for all records that don’t have a value for a given field ) by using the syntax:
-field:[* TO *]
However, using this was throwing errors for me until I switched to:
-field:[* TO ]
Now you know.



From snail mail to email

3 December 2007 | 15:36 | misc | No Comments

This service seems super cool: http://www.earthclassmail.com/. It basically scans your mail and sends it to you as a pdf with the option of having certain items recycled, shredded, or forwarded to you unopened.
I hate opening mail and dealing with filing/shredding/recycling things and this seems like it could make my life a tad easier.
Now if they […]



How to alias a class method in Ruby

21 September 2007 | 10:04 | ruby | No Comments

class << self
alias_method :new_do_thing, :old_do_thing
end

Now I know.



XMLRPC::Client#do_rpc: Client-Type charset param incompatible with some blog’s MetaWeblog APIs

17 September 2007 | 21:00 | magnolia, rubyonrails, xmlrpc | No Comments

We recently added an automated posting feature to Ma.gnolia which uses XMLRPC and the MetaWeblog API to post a summary of a user’s bookmarks for a given time period to their blog. To implement the MetaWeblog client functionality we wrote a lightweight wrapper around Ruby’s XMLRPC::Client class.
After we released the feature to beta testing we […]