Programmatically Turn Off Comments in Wordpress with Filter
To turn comments off programmatically with a filter in Wordpress, you can set the post object's comment_status variable to "closed". Call the filter at some point after the post is loaded but before the comments are rendered. This is a hack, but I haven't...
A Couple of Usefule Snippets When Working with Textmate
Here is the snippet
f path/to/directory 'search string' | open_in_mate
This snippet (technically 2 snippets) will recursively scan the contents of files in a directory and then open all the files it finds in Textmate.
It's useful on large projec...
Fixing MySQL for Rails 2.2 Development on Mac OS X
Oh what trouble Rails 2.2 and MySQL (on Mac OS X) can be. Rails, as of version >= 2.2, no longer comes bundled with the MySQL adapter. This means you'll need to install it yourself, but it appears that the gem for installing it is also broken.
This will ...
Cool Conditional Syntax in Ruby (on Rails)
Ruby is beautiful
How to Render Partials with an Underscore in Sinatra
Sinatra doesn't have a method for rendering partials. It defers to the template language of your choice. For instance, if you're using ERB, it's as simple as
Rails has a nice convention of using an underscore to mark file...