Adium Top Words

Saturday 11/29/2008  –  Category: Uncategorized

I have a strange habit of periodically going through my chat logs and re-reading random conversations.  When I was doing this yesterday, I wondered what my most frequently used words were in IM land.
Since Adium log files are in nice XML format, I decided to write a Ruby script to process all my logs and [...]



Apache and DirectoryIndex

Friday 11/28/2008  –  Category: Uncategorized

If you’re getting this error:
Request exceeded the limit of 10 subrequest nesting
make sure your conf file has the DirectoryIndex variable set correctly. I had accidentally copied a conf for a Rails app that had the line
DirectoryIndex /
which was making Apache not serve the index.html file like it usually does.  Once I got rid of DirectoryIndex [...]



:layout => false

Thursday 11/27/2008  –  Category: Merb

I ran into a strange behavior when trying to use setInterval in JS to make an AJAX request every n seconds.  I had the timer in the $(document).ready(function() { } in the head of my application layout file.
There would be strange behavior with the timer–every interval would be twice as fast as the previous, and [...]



Getting a random record using datamapper

Thursday 11/27/2008  –  Category: Uncategorized

Model.get(1+rand(Model.count))
You’ll have to have dm-aggregates for Model.count to work correctly



ruby strip vs strip!

Thursday 11/27/2008  –  Category: Uncategorized

Sorry to disappoint, but this entry isn’t about strippers.
str.strip returns a copy of string str with with whitespace chopped off, while str.strip! returns the same string str or nil if the string wasn’t altered.
I didn’t realize str.strip! would return nil until I was getting a lot of empty strings back…



 Page 1 of 4  1  2  3  4 »