Uploading docx files with Paperclip and Rails

I just ran into an issue with the Paperclip gem not allowing a user to upload documents of the docx variety even though I had the ’application/msword’ content type allowed in my model.  It turns out that the docx content type is a much longer string.  To get the upload to validate properly, you need to...

Importing a CSV into MySql

We’re working on the new blenderbox site, and we’re moving from SQL server to a MySQL server and I wanted to quickly move our project data from our old server to the new one. I came across a great way to import data into a MySQL database directly from a CSV file. Firstly, you’ll need...

Reindexing node types in Drupal 6

I’ve been reworking search functionality on a fairly large Drupal 6 installation.  Until recently, every time I changed what the search indexed for a custom module, I just went to /admin/settings/search and clicked ‘Re-index site’. This works on smaller websites, but when a website grows to have thousands and thousands of searchable nodes, re-running the...