Handling Time Zone Conversions in Rails

A couple of days ago, an HourPatch customer emailed me with a bug he'd found. When he created a time entry on a Saturday night, that entry would "jump" a week ahead on the schedule. I was able to fix it pretty quickly, and it turned out the problem related to time zone conversions, so I thought I'd share a little of what I learned when fixing that bug.

UIView: How to Make Shiny Backgrounds and Other Reusable Styles

When I first started making iPhone apps, I wrote a lot of repetitive code to style interface elements. Certainly, getting comfortable with Interface Builder eases that pain to some degree, but IB won't allow you to take advantage of a lot of available built-in styling features for your interface elements, such as curved corners, drop shadows, and stroked borders. Additionally, you can create beautiful gradient backgrounds in code pretty easily, but the code is somewhat verbose, so it really pays off to find good ways of re-using that kind of code. Also, using a programmatic approach to your app styling can eliminate the production time associated with image-based styles (e.g. custom background images). A lot of common effects used in UIs can be realized without any images whatsoever.

iPhone: How to Dynamically Color a UIImage

In my recent work on Sphericle, there were a few instances where I wanted to use the same image over and over, but colored differently each time. For example, I want to show spheres of different colors on a map; there are 360,000 spheres, each having its own color. I didn't want to draw the sphere algorithmically; I wanted the picture of a sphere to be based on an image, but then colored appropriately. The solution: use a grayscale image of a sphere, then draw a color over it using a color burn blend mode. That's what I want to show you today.

Goodbye Gallup: Twitter-Based Election Polls

The other night I had an idea: Create a web service that uses Twitter to poll the upcoming elections. I'd love to see if something like this could give accurate predictions for election results. And, it would be a transparent (although not anonymous) polling system. Here's how it works:

How to Update Your Drupal Install Using Subversion

If you use Subversion to manage code updates to your Drupal-based site, then chances are that whenever an update to the Drupal core comes out, it's really annoying to use. You don't want to go copying your sites/ directory from the old version to the new, since all your .svn directories are in the old version. It's just a big headache. Luckily, there's basically one command you have to run to painlessly update Drupal (with just a little bit of set up). Here's how:

Lessons Learned from 3 Weeks of Using KISSinsights

A few weeks ago, I decided to give KISSinsights a try on the Coffeeshopped website; I had recently read Neil Patel's article "What I learned about you through KISSinsights", and it convinced me that there's probably a lot I can learn from asking my readers a few questions. I have the free account with them, so I wasn't able to make up my own questions, but they have some built-in questions that seemed appropriate. So, over 3 weeks, I tried 3 different surveys... here are the results.

What's in Store for Sphericle 3.0?

I've been working on the concepts and design for Sphericle 3.0 lately, and I want to share some of what I have so far. The past versions of Sphericle have not been designed nearly as well as they could have; I rushed into development too early, and the game suffered for it. This time around, I want to make it very pretty, more intuitive, and more fun! Here's some of what I'm working on:

Photoshop: Create an iPhone Google Map-style Shadow for Icons

While working on the next release of Sphericle (which is going to be awesome), I've had to create new map icons for the Search screen in the app. I want these icons to have the same style of shadow as the Google Map pins do on the iPhone. So, after some experimentation, I found a pretty easy and accurate way to do that. Here's what we're starting with:

Icon without shadow