In the middle of ironing out some wonky code, I came across a lovely issue with IE (who hasn’t?) stemming from its habit of adjusting the mime type of submitted jpegs as “pjpegs” or progressive jpegs. The issue is well documented, but I was continuing to have issues with formatting correct image types. The situation seemed hopeless.

What I was originally convinced was an input problem actually ended up being an output problem, namely how the images were being rendered by my image view controller.  Below illustrates a perfect example of a quick, hacky solution that ended turning around and stealing 5 hours of productivity down the road.
Take a look:

$image_types = array('image/jpeg', 'image/gif', 'image/png');
//selecing only images
$pictures = $this->Job->Upload->find('all', array('conditions' =>array('Upload.job_id' => $id, 'upload_content_type' => $image_types)));
//selecting everything else (pdf, document, etc...)
$documents = $this->Job->Upload->find('all', array('conditions' =>array('Upload.job_id' => $id, "NOT" => array('upload_content_type ' => $image_types))));
//send results to the view
$this->set(compact('pictures', 'documents'));

Harmless enough, right?

Do it right, or don’t do it at all. Shame on me.

Don’t make the same mistake.

 

Well, at least that is done.

I spent a better part of this week testing nearly every facet of the new Event-O-Matic and am incredibly pleased with what I’ve pushed out the door. This release was actually scheduled to be a 1.5 release, but after rewriting nearly everything and ending up with as far away from a version as what I started with I realized it was only possible to release this as its own stand alone version. I do despise tagging anything this with the oft overused “2.0″ suffix, but after minute bug notifications pour in I can be assured that this will be in the 2.xx range very soon.

I’ll cover the details of what was changed and some of the lessons learned in this version, but for now I’ll need to step away from this guy for a couple days and concentrate on Eventuous (more on that later).

I’m building a site that needs the wonderful Supersized jQuery module for background effects. I’ve seen several sites out there promoting integration into wordpress themes, but all of them are lacking in proper WordPress conventions. To avoid headaches, include your scripts and styles correctly into your themes and you won’t anger developers down the road when conflicts start to arise. It’s very simple. Always use wp_enqueue_script() over directly inserting js calls. ALWAYS. Doing it the right way will negate all conflicts down the road.

Benoit De Boeck has a good tutorial on his site about integrating Supersized into WP, but a couple small missteps will likely snag the WordPress Novice. Here are a few things to keep in mind when reading his tutorial.

1. Download Supersized and add the contents into your theme directory as instructed.

2. Call the supersized stylesheet, but use wp_enqueue_style(); instead. Observe:

<?php wp_enqueue_style( ‘supersized_style’, get_bloginfo(‘template_url’).’/supersized/css/supersized.css’); ?>

Edit the supersized stylesheet accordingly to update image paths.

Now, include the two .js files needed for Supersized to work: jquery and the Supersized .js file. USE wp_enqueue_script();

<?php wp_enqueue_script( ‘supersized_js’, get_bloginfo(‘template_url’).’/supersized/js/supersized.3.1.3.min.js’, array(‘jquery’)); ?>

Note that we are only calling jquery indirectly- since we added ‘jquery’ to the dependency array argument wordpress will know to call jquery when appropriate.

In this way we have told WordPress that we need jquery, but left the heavy lifting up to WordPress itself. The enqueue function will only call jquery once, removing the possibility of conflicts. When we call the Supersized .js file, we add the second argument to let WordPress know that ‘jquery’ is a dependency, thus WordPress will also call the .js files in the proper order.

Lastly, his script is calling jquery improperly. WordPress natively runs jquery in “No conflict mode” so you will need to replace his

jQuery(function($){

With:

jQuery(document).ready(function($) {

Nearly every one of these items, if left uncorrected, will cause serious headaches to the unprepared. Do your blog some good, and use proper conventions when developing your themes. Cheers!

Today’s EC2 mess should tell you everything you need to know about the pitfalls of cloud computing.

I just uninstalled Adobe Flash CS5 from my laptop.

Throughout the course of a given workday I’m asked this question more than once:

“What are you working on right now?”

I’ll run through the laundry list of current projects and the stack of future upcoming items yet will invariability terminate the sentence with this:

Well, the one thing I’m NOT working on at the moment is my own online portfolio.

Such is life. I spend a gigantic portion of my day working creatively for others, only to get home and not touch my own portfolio. Well, let me revise that; I’ve started designing my new site about a dozen times. It’s that wrapping up component that is the hard part. Mainly I’ll get to a point and severely dislike the visual course I’ve charted and give up, hoping inspiration strikes another day.

Let me lay out a couple culprits I think is at play here, how it affects us all at our jobs, and tell you how I overcame the whole affair.

Continue reading →


AA redesign

This unique case study of American Airlines’ website is a telling (and in my case, ever too reminiscent) reminder of what poor organization within a company’s structure will inevitably contribute to in the construction and maintenance of large scale corporate web environments. Read the article, then ask yourself, per the quote:

But–and I guess here’s the thing I most wanted to get across–simply doing a home page redesign is a piece of cake.

If the case was truly about the simplicity of homepage development, could even that task be completed within the corporate structure outlined within the AA organization documents?

Des Traynorover at Contrast has put together anexcellent piece on the inability to codify granular changes within an existing web application. The situation he brings up highlights one of the fundamental “disconnects” between the developer of a web application and those outside the bubble (management, marketing, client, etc.). McCabe illustrates a fictional scenario where a client asks to make a small change to an existing application in order to (someday) allow SMS transmission in the future.

I call this situation a disconnect because intrinsically both sides of this argument have valid points, however it is almost always impossible for both parties to see the benefits the other is trying to offer. The client would like to add features to their product to benefit their audience (offer SMS!), while the developer only sees the changes as taking away from the audiences experience with the application (Why only 140 characters?).

http://www.contrast.ie/blog/there-are-no-small-changes/

“A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.” – Antoine de Saint-Exupery

There are a couple guidelines I work by with nearly every project I undertake. Some of them are listed below.

Continue reading →