Will Oller .com

Avatar

Learning to match the beat of the Old World man.

Generating amazing reports using Basecamp (Part 1 - Tagging)

We’ve been looking for good ways to produce advanced reports using Basecamp. We have hit upon a system in which we implement a rudimentary tagging system, and add additional metadata for time estimation.

In this first part, I will explain the simple tagging system. Next time, I will tell you all about the Big XML Dump.

Tagging System

Tagging will be implemented using { curly braces } around a comma-delimited list. We will be using our regular work categories as tags, so a typical todo-list might look like:

Implement new feature {Programming}

  • Add new processing loop
  • Create new template {HTML Production}
  • Connect to pre-existing API

We want our tagging parser to be smart, and change an item’s tag list on the fly based on it’s parent item’s tag list. That sounds complicated; here’s an example using the list above.

Computed Tags

Implement new feature {Programming}

  • Add new processing loop {Programming}
  • Create new template {Programming, HTML Production}
  • Connect to pre-existing API {Programming}

The italicized tags are derived from the list’s name (Implement new feature) and will be programmatically added.

Time Estimation

Time estimates are handled in much the same way as the tags, just using straight brackets instead ([, ]).

Adding time estimation to our list:

Implement new feature {Programming}

  • Add new processing loop [1]
  • Create new template [6.5] {HTML Production}
  • Connect to pre-existing API [9]

This way, each todo-item has a time value associated with it. We will use this data later on to test our estimation skills and to quantify our productivity.

Next: Part 2 - The Big XML Dump

Limiting title and excerpt length with Wordpress

Sometimes clients have very specific requirements. Sometimes they want autometic controls on simple things they have total control over anyway. I digress.

In this case, blog titles needed to be of any length, but have their lengths truncated under certain circumstances. Furthermore, excerpts need to be able to be the default length (50 words), but shorter (10 words) under those same certain circumstances.

Fortunately for me, the excerpt was easily fixed using a plugin called the excerpt reloaded.

http://guff.szub.net/2005/02/26/the-excerpt-reloaded/

Next, for the title length requirements, you will need to modifiy a core file: wp-includes/post-template.php.

PHP:
  1. function the_title($before = '', $after = '', $echo = true, $length = false) {
  2.    $title = get_the_title();
  3.     if ( $length && is_numeric($length) ) {
  4.        $title = substr( $title, 0, $length );
  5.     }
  6.     if ( strlen($title)> 0 ) {
  7.        $title = apply_filters('the_title', $before . $title . $after, $before, $after);
  8.        if ( $echo )
  9.           echo $title;
  10.        else
  11.           return $title;
  12.     }
  13. }

Finally, when in The Loop, call the_title() like this:

PHP:
  1. <?php the_title('', '', true, '40') ?>

Now, the title will be a mere 40 characters long, and the excerpt (using the_excerpt_reloaded()) can be any desired length.

fuser

Ever tried to unmount a drive only to get hit with a mysterious "in use" message?
Even when you are sure you are not using it?

Yea, that was one of the early problems that made learning linux tough. Then I learned about the fuser command:

fuser -v /path/to/mount

You will get back what process is still using that mountpoint, and who owns that process:

USER PID ACCESS COMMAND
root 2117 ..C... /bin/bash

As you can see, I accidentally left a terminal open. Oops.

Related Links

Continue