Updated CodeIgniter DB2 driver

If you fall into the extremely unlikely event where you both need to access DB2 with CodeIgniter and have run into a situation where the latest database driver doesn’t work, I’ve got the fix for you. This may be because you are setting the charset or you require a different port than 664 (50000 being the port used by many for DB2).

Hence, I have updated the driver to heal all that ails.

http://codeigniter.com/wiki/DB2_Database_Driver/

Monday, February 8, 2010

Why isn't Blueprint (or any other CSS framework) a good idea?

Let me start by saying I really love the idea of saving time when I design and develop a site—I use all kinds of time savers. Any well thought out system that results in cleaner, more maintainable, simpler code is definitely a good thing. Thusly, I’ve used CSS frameworks in the past to save time building layouts and creating grid-based, standards-compliant websites. So, why isn’t Blueprint (or any other CSS framework) a good idea?

To answer this question, you must acknowledge that CSS is not a language that can be properly generalized with a conceptual structure. This is the reason why Jeffrey Zeldman writes the words CSS framework as CSS “framework”—that is, these things are not really frameworks in any sense of the word. They are (or attemtp to be) a one-size-fits-all stylesheet. Given this, the reason why these “frameworks” are bad is not about the frameworks themselves, it’s about the pattern they force you into.

What do I mean—ok, take for example a site I launched for Flipswap a few month back. The total time for designing, developing, copywriting, and launching the site was a little over two weeks. We cut out some best practices like IA and an exhaustive comping stage, but also took liberties with the development of the site. To quickly set type and control measure on a wide page, you normally split large chunks of copy into columns, add a sidebar for meta data, and all the usual stuff that makes a page with a lot of copy easy to digest. However, given our short timeline, I setup Blueprint and did my layout with div’s and classes while marking up the copy. This was a very simple and quick process and we got out some reasonably attractive pages on time. The key here was that I was saving time by doing design/layout while I was writing the markup. I was mixing my content layer (HTML markup) and presentation layer (CSS).

What I had done was paint myself into a veritable corner. That is, I had ignored the good natured sensible me that would markup the copy with semantically sounding classes and ids in favor of a me that was essentially creating a table layout. This is the pattern that Blueprint and other CSS frameworks force you into. When it comes time to redesign or reuse pages for a future site, I will have to redo everything over again. That’s not so much a timesaver as it is a pain in the ass. For the sake of clarity, here’s some example HTML to illustrate my point:

Valid, standards-compliant Blueprint framework-based layout

<div class=”span-20”> <div class=”column span-10”> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> <div class=”column span-10 last”> <p>Iqui officia deserunt mollit anim id est laborum.</p> </div> </div>

Valid, standards-compliant table-based layout

<table width=”200”> <tr> <td width=”100”> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </td> <td width=”100”> <p>Iqui officia deserunt mollit anim id est laborum.</p> </td> </tr> </table>

Honestly, what’s the difference between these two things? Both have no content/presentation separation and no semantic markup. When you design with a CSS “framework” you may as well design with tables. Welcome to 1997, how does it feel?

So, what could a CSS framework be good for? It’s good for the one scenario where you are using a CMS and you have no control over your CSS, you can handcraft your non-semantic HTML by hand, and you never-ever plan to redesign or repurpose your content in an altered form. And that’s it.

Wednesday, December 30, 2009

SDG + Typekit

Last night I did some regiggering to the Sentinel Design Group site in order to do a bigger redesign quicker and easier in the next few days. Part of that process was upgrading to Nanoc 3, a Ruby-based CMS that generates flat HTML. It’s a pretty simple concept—one that you wouldn’t think is all that helpful—but it really speeds up development.

The interesting part, though, is that I finally added some Typekit flavor to my copy. I’m a sucker for well-designed, subdued style type, and Typekit finally added a bunch of this from the FontFont type foundry.

For the headings I’m using FF Meta Small Caps Web Pro and for the body copy I chose FF Meta Serif Web Pro.

Before:

After:

Thursday, December 10, 2009

The Angry Crowd Strikes Again

While I was checking out this slick email marketing site Mail Chimp, I noticed something rather peculiar—the crowd behind the chimp looked uncannily similar to something I’d produced a few years back. I thought for sure they had somehow dug into my discarded pile of Flipswap comps and gleaned a piece of my work. But, alas, it turns out even though there is a likeness, no wrongs have been committed.

I’m kidding of course. But, check it out for yourself. Here’s an unused development comp from April 7, 2007. (Avert your eyes from the hideous Arial Rounded MT Bold, it was the company’s standard type at the time.)

Now, here’s a very similar angry crowd almost two years later:

And the crowd sans-chimp:

By the way Mail Chimp, if you want to pay me back for the artwork that you didn’t steal, I’d totally love to get my hands on that $240 plan for the sweet price of free. Wha’dya say?

Wednesday, December 9, 2009

MuseoWatch 2009

Whenever I recognize a font that I’ve used before, I immediately develop an irrevocable hatred for it. The latest recipient of this maddening dislike is exljbris Font Foundry’s Museo, an organically-seriffed typeface that I used in the last revision of the Flipswap site. A specimen:

See, here’s how I used it:

The problem came when I saw these two sites last week. These two services look very interesting, but why must they ruin this font for me. I mean, for the love of god, it was free and good. Exhibits A & B here:

By the way, if one of you guys from SimpleGeo could pass me some love in the form of a Beta account, I’ll consider it payment for the beta apps I helped test for CrashCorp. He he he.

Monday, December 7, 2009

WordPress Title Trickery

Here is a bit of the code we’re using on a new site redesign. We needed a custom, more descriptive title on certain pages.

It grabs a title from a custom field if you set one, or just gets the page title if you don’t. Also, since WP doesn’t display the page’s title if you’re on the homepage, we’ll grab custom text from the site’s description (which we don’t use for anything else).

<title>
<?php 
	$sep = ’ | ‘;
	$site = get_bloginfo(‘name’);
	
	if(!$title = get_post_meta($post->ID, ‘title’, TRUE)) {
// we need this because page title
// isn’t shown when on homepage if(is_front_page() || is_home()) $title = get_bloginfo(‘description’); else $title = wp_title(”, FALSE, ‘right’); } echo($title.$sep.$site); ?> </title>

Tuesday, December 1, 2009

Ok people, this is what happens when you don’t have HIG (human interface guidelines) for your platform. These Android Developer Challenge entries represent a core sample of the best applications Android has to offer.

Based on the icons alone, it is clear what kind of junkiness you can expect in app they represent. This kind of stuff is endemic in the open source community.

Do any of these scream “quality” to you?

Tuesday, December 1, 2009

Python: List Comprehension, Closures & Lambda

The best part of learning is being able to share your knowledge is a way that’s autodidactic & condescending. So, here’s a little (possibly obvious) nugget I came up with for using list comprehension, closures & lambda.

My problem: How do I take a list of n-dimensional coordinates, and make a list of just one of the coordinates?

You could do it like this with list comprehension:

lst = [ [0, 1],[1, 3],[2, -1],[3, 4],[4, 7] ]
print [y for x, y in lst] # prints [1, 3, -1, 4, 7]

But that’s lame and we have that ugly thing for every coord we need. How about using a closure to make it more general, like this:

# here we're making a function that makes a function
# using 'i' as a way to "customize it". this is a closure.
def get_coord_factory(i):
def get_coord(lst):
return [coords[i] for coords in lst]
return get_coord

# make a customized function that only returns 
# the x coordinate. we would make one of these for
# y and z too and reuse them. 
get_x_coord = get_coord_factory(0) 
print get_x_coord(lst) # prints [0, 1, 2, 3, 4]

But wait, in our closure we have a one line function with no statements and one expression. Sounds like a lambda function to me. Let’s rewrite that factory to use a lambda:

def get_coord_factory(i):
return lambda lst: [coords[i] for coords in lst]

Ok, so there you have it, we’ve combined these three nifty features into something that’s useful and entertaining. Here’s the full listing:

lst = [ [0, 1],[1, 3],[2, -1],[3, 4],[4, 7] ]

def get_coord_factory(i):
return lambda lst: [coords[i] for coords in lst]

get_x_coord = get_coord_factory(0)
print get_x_coord(lst) # prints [0, 1, 2, 3, 4]

Thursday, November 26, 2009

More on Push

I just came across this little iPhone app that displays Growl notifications on your phone that originate from your computer’s Growl-compliant app. It’s called Prowl, and it’s exactly what I had in mind when I wrote my little piece on iPhone Push notification two weeks ago.

Had Apple chosen to allow 3rd party background apps in favor of its notification service, this kind of thing would’ve been a near impossibility—not for the technical piece that lives on the iPhone, but the huge amount of potential bandwidth and complex infrastructure from the building a service from scratch. Furthermore, it would be Apple with the device that has a battery capacity problem. That’s not really the point though.

Wednesday, July 8, 2009

Poor Man's Guide: Deployment with Git (and GitHub)

Git is one of those things that when you learn it, you start looking for reasons to use it. I would describe it as frictionless version control. Although the king of nerdy, abrasive verbosity, Linus Torvalds explains it as really just a filesystem—it’s the way that you use it, through its minimal, command-line interface that makes Git so efficient.

The technical stuff I’m not great at, so use the these guides for installation. Also, check out this radical guide for getting started.

So, I use Git for all my personal projects and a few things at Flipswap. But, occasionally I have a need to deploy my work to a live server. I have a GitHub account so my hosted repository needs are taken care of, but I have yet to see a simple script that outlines how you’d actually do a deployment with Git. In hindsight, that’s probably because it’s so easy. Take a gander.

I have a shell script in a directory outside of my httpdocs directory called “private”. The script pulls in any updates from the repo hosted on GitHub into my “site” directory (which is below the “private” directory). Then copies everything sans hidden files (including the actual git files) to my “httpdocs” directory. The script looks like this:

echo “Updating…”
cd site
git pull
echo “Copying…”
rm -rf ../../httpdocs/*
cp -rf * ../../httpdocs/
# do any permission changes here…
# chmod 777 ../../httpdocs/system/cache
echo “Done.”
Tuesday, July 7, 2009