• 15 Aug 2013Transcoding can be hard.

    Dealing with an arbitrary text file encoded in an unknown way and trying to normalize to UTF-8 (with minimal data loss) is a tricky thing.

    read more

  • 30 Apr 2013Fix mysql2 "Incorrect MySQL client library version! This gem was compiled for..."

    After updating my mysql install on I got the following error: "Incorrect MySQL client library version! This gem was compiled for 5.5.15 but the client library is 5.6.10."

    read more

  • 29 Apr 2011Get Heroku pgbackup captures every ten minutes for free! (almost)

    You might have heard about the recent AWS outage. Needless to say this outage affected many websites and also many services that piggybacks on AWS cheap cloudy goodness. Heroku is one such service. Heroku also happens to be the service of choice for the startup I work for. While I applaud the herculean effort both by Amazon and by Heroku to manage and mitigate the disaster, the whole thing caught us a bit with our pants not properly around our proverbial waists. It turns out Heroku's database backup feature, pgbackups, is not a one click automatic affair.

    read more

  • 06 Feb 2010Trying to use Rails CSRF protection on cached actions? Rack middleware to the rescue!

    With the release of Rails 2.0 came some very nice security enhancements. Among those was CSRF protection (cross site request forgery) which is implemented by putting a server side generated token into a hidden field inside of forms with POST, PUT, or DELETE as the action/method. When Rails is asked to render a page that contains a form with any of these methods it generates an authenticity token. This token is stored in the session object and rendered out to the previously mentioned hidden field. Anytime Rails receives a POST, PUT or DELETE request to one of these actions it will ensure that it was given back the previously generated token or else raise an error and not execute the action.

    read more

  • 19 Aug 2009git merge vs git rebase: Avoiding Rebase Hell

    Learning Git can be a pain in the ass sometimes (OFTEN). One feature that has continually caused me to pull hair while I was climbing the learning curve is git-rebase. Rebase is a very useful tool, but also gives you more than enough rope to hang yourself with.

    read more

  • 24 Oct 2008Blacksmithing: The creation of an 11-12th century Norman helmet

    At the start of the fall semester I began a continuing education class at the New York School of Visual Arts Advanced Metalworking. The goal for taking this class is to construct a 11-12th century Norman helmet for use in full contact western martial arts in the SCA. I am beginning this post over a month into the class as much of the initial class time was spent honing skills and techniques needed for smithing.

    read more

  • 22 Aug 2008Faking the funk: "Stub" authentication in a Rails Rspec Story

    Last week a ran into a bit of an issue trying to write Rspec Stories for the app I am working on. The app in question depends on a remote service based authentication system. Creating "test" users on a remote user authentication service already running as production for other apps was not really an option. Getting around this proved to be problematic as Rspec Stories entire point is to test the "full stack".

    read more

  • 15 Jul 2008Merb CRUD - ie: how to properly destroy things

    By now most Rails developers have come to know and love (or not?) RESTful resources and the controller code that implements them. For the most part Merb's implementation of resources will be familiar and adheres to the same convention - GET safe creates, updates, destroys, a single base URI for a single resource, etc.

    read more

  • 22 May 2008Headed to Portland!

    So its finally official... I am headed out to RailsConf in Portland, OR next week!

    read more

  • 14 Apr 2008VIM is good for your health!

    Thanks to my good friend and mentor Jerry Jackson forcing me to practice every day until I grew to like it, I am a die hard VIM user. To me it is just a much faster way to write code and edit text in general.

    read more

  • 24 Jul 2007Custom image form submit buttons - What is the correct approach?

    Clients, those crazy people, sometimes they get these funny little ideas like: hey wouldn't it be neat if the form buttons looked like \{insert cliche web2.0 button style here\}:. My initial answer to this is that the UI the browser creates for you is the most usable and least likely to create problems across different browsers and platforms

    read more

  • 19 Jul 2007CSS: Pipe Delimited List Menus

    First of all - what the heck is a "pipe"? The character referred to as a "pipe" (|), in Linux, Unix, or OSX, is used for redirecting the output of one terminal command into another (ls | grep "something"). It is also very commonly used, albiet only for presentation, to delimit individual items of a site navigation or other menu. By now, any professional web developer knows that a menu of any sort belongs inside our good ole friend the unordered list. I won't go into the benefits of using semantic markup here, but I do want to share my technique for achieving this very common menu style without adding any extra markup or unnecessary characters.

    read more

  • 17 Jul 2007CSS: Advanced Formatting and Organization

    Gone are the days of the table based layout... days where CSS, if used at all, would simply be a replacement for the notorious font tag. In this day it is very common for a stylesheet to contain many times more line of code than its corresponding XHTML document. Part of the challenge of writing good CSS is not just learning the correct properties to use, but formatting and organizing your document in a way that allows for easy maintenance and speedy display bug fixes.

    read more