New Mini Business Cards

I just ordered a set of 100 mini business cards ( half-size ) for just the price of shipping, 6.75 CAD, from moo.com. Order your free cheap 100 cards ( really ).

Every few months they have a promotion by teaming up with another online company to bring this kind of a special. I’d ordered through Movember last year, in April 2011 through About.me, and this time it’s the Klout service.

p.s. Thanks to Terry Smith, a Winnipeg Front End Developer, @DesignCollider for tweeting out that she got the cards. Couldn’t have gotten them without you!

Patch for JWPlayer

I made a website for the Positive Parenting Program of the Manitoba Government while working at Canada’s Web Shop, and it had videos on one of the pages. Because the videos are self-hosted, I used the excellent JWPlayer for WordPress plugin, and it worked great except that when the staging site was brought down the videos stopped working.

It turns out that JWPlayer for WordPress is using WordPress guids instead of using the wp_get_attachment_url() function that makes it safe to move your WordPress website between domains. In short, the guid column in the posts table stores the original URL of the video, and if you change domains, the only way to get the correct URL is to use the aforementioned function.

I wrote a little patch, notified LongTail Video, and it is on its way to being included in the plugin.

June Hip-Hop Playlist

Get the Flash Player to see the wordTube Media Player.

Portfolior

Portfolior, eh!?

Portfolior is the WordPress theme created for the presentation I am giving/gave at the Winnipeg Code Camp 2010.

The word “portfolior” is a system-ization of the word portfolio. Another system-ization example would be “reporty”.

The term system-ization represents efforts of (non)creative programmers to come up with a good system name, so to keep the meaning of what the system does, they choose the most appropriate word, and then try to make it sound like a machine that would do the task the system does.

What a rant!

Secret Handshake

I had fun at the Secret Handshake meetup last night. It was great to meet some great young people working in different professions.

I met some Rails Web developers: @marcjean, @gmarik, @ssoroka

Some network security experts: @ron_bowes, @xorrbit

Some designers: @toderash, @timder, @instant_noodles (instantnoodles.ca)

SEO/SM: @thewebgrrl (who I met at the Winnipeg WordPress meetup), @steveosnyder

And some other people, including @TishTishTish, @visuallizard, @4letterw0rd and others.

Notable quotes:

“Vim is better than emacs” – @marcjean
“We could make it into a framework that people can extend and use however they want” – @ssoroka

Best business card: @toderash with Strategic Intuition. An oversized piece of paper, with perforations to tear out the business card (But beware, the small print below the perforation says: “Tear here to limit thinking”). It can stand up, and be used like a table name tag.

I had a little bit of trouble finding the place, I think mostly because I did not have my glasses on, so I could not read their sign, since I did go by the place twice before I finally entered it the third time.

Refactoring PHP

Here are some common opportunities for improving the maintainability of code through refactoring that I find when reading code.

  1. Replace Duplicated HTML with Iterating Over an Array

    The purpose of most PHP code is to output HTML that the web server will send back to the browser. If you have a table that has 20 rows, and all those rows have the same structure, but the data in each row is different, you could write it 2 ways:

    1. Duplicated HTML

           <tr>
             <td align="center" valign="middle" class="messageFormTd3">2010-05-04</td>
             <td align="center" valign="middle" class="messageFormTd3">Copenhagen</td>
             <td align="left" valign="top" class="messageFormTd3">City Hall</td>
             <td align="center" class="messageFormTd5">10:15</td>
           </tr>
           <tr>
             <td align="center" valign="middle" class="messageFormTd3">2010-05-02</td>
             <td align="center" valign="middle" class="messageFormTd3">Zagreb</td>
             <td align="left" valign="top" class="messageFormTd3">Main Square</td>
             <td align="center" class="messageFormTd5">12:30</td>
           </tr>
    2. Iterating Over an Array

                 <?php foreach (array(
                   array('date' => '2010-05-04', 'city' => 'Copenhagen', 'venue' => 'City Hall', 'time' => '10:15'),
                   array('date' => '2010-05-02', 'city' => 'Zagreb', 'venue' => 'Main Square', 'time' => '12:30'),
                 ) as $event) { ?>
                 <tr>
                   <td align="center" valign="middle" class="messageFormTd3"><?php echo $event['date'] ?></td>
                   <td align="center" valign="middle" class="messageFormTd3"><?php echo $event['city'] ?></td>
                   <td align="left" valign="top" class="messageFormTd3"><?php echo $event['venue'] ?></td>
                   <td align="center" class="messageFormTd5"><?php echo $event['time'] ?></td>
                 </tr>
                 <?php } ?>