import a gzipped database backup

I’ve been gunzipping my MySQL dumps before importing them.  This was always mildly annoying – especially when working on Drupal projects where the database seems to get passed around a lot. Today I found a more concise approach: use gzcat to read the contents of the gzipped file directly into your database like this: gzcat...

Setting up MCFileManager on Drupal 7 with Capistrano

I needed to install MCFileManager on a capified Drupal 7 project.  I followed these instructions, but changing the upload directory and getting things to work with Capistrano was slightly complicated.  Here are a few lessons I learned… 1. The filemanager module must be installed in /sites/all/modules I’ve been installing all contributed modules in /sites/all/modules/contrib, but this didn’t work...

Can’t open file: ‘sessions.MYI’

Sometimes, we are responsible for helping clients maintain older products that we didn’t build from the ground up. One of those products is oscommerce. Today, I had an error I had never come across. Can’t open file: ‘sessions.MYI’ I did some googling and most of the results said to go in with phpmyadmin and run...

jQuery 1.6.1+ and setInterval

I recently created a quick jQuery gallery plugin for a client that auto scrolls using setInterval and, when I was done, I left my tab hidden for a few minutes to look at something on another website.  When I went back to my tab with the gallery, WHAM! I was stuck with a gallery automatically...

Git Basics

For anyone new to git, I thought I’d share some tips. This tutorial assumes you are using the terminal (Mac/Linux) or command console (Win).  You should have a basic knowledge of the terminal/console.  You should also already have git installed.  There are many ways of doing this and they are well documented elsewhere. Here is...

Install wowza media server on Amazon EC2 and S3

UPDATE from Oliver: Note: Elastifox does not work in current versions of FF, no matter what trickery is employed. You can easily achieve the main goals in this tutorial via the AWS Management Console. For this tutorial, we’re going to assume that you have Firefox and ElasticFox installed and that you already have an AWS account set...

Pro-tip for form autocompletion

Have you ever been editing a user record in your CMS and tried to save the form, only to get an error that the passwords don’t match even though you didn’t try to update the password? I have. And it’s annoying. Very annoying. Here’s a little tip to help resolve that issue. When creating a...

Can’t convert Syck::DomainType into String

I just tried to set up a new environment for a rails site I’m working on and I was getting this error when trying to migrate the database. can’t convert Syck::DomainType into String I couldn’t find that error on google at all, but it turns out the password I was using had both a hash...

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...

Styling placeholder text in HTML5

Another quick tip for styling input elements in HTML5.  To style placeholder text, you can use the following CSS: ::-webkit-input-placeholder { color:#282218; } :-moz-placeholder { color:#282218; } That’s it!  I assume that, once it’s supported by more browsers, it will change to input-placeholder or just placeholder.  We’ll have to wait and see on that one.

Styling search input types in HTML5

For some strange reason, Safari likes to hijack the styles of an input with type=”search” in HTML5. It makes them appear all ‘Apple OS’ like. It can be very annoying, and until recently, I thought it was very un-avoidable. Fret not my dear CSS legends! You too can take back control and keep your forms...

bundler installing gems into the rails root directory

I’m working on the new blenderbox.com website and we’re doing it in rails 3. I’ve had a great experience with rails 3 so far and all of the changes are really great. However, I ran bundle install from my root directory today and all of a sudden, my bundler installed all of my gems into...

before and after

A client came to us recently and asked us to duplicate the functionality seen on this nytimes article. One of our talented designers, Jacks, came up with an updated design and passed it along to me for development. At first glance, it seems like something that would be a little tricky to re-create without flash....

Ubuntu 10.04 LTS Terminal Opacity

I upgraded my Ubuntu machine to the latest LTS build last week and was quickly disappointed that my terminal no longer had opacity. No matter what I did, the window would just appear as a solid color. I tried googling, etc. but couldn’t find any solution online. I gave up and ended up editing my...