Consultant Agency Off and Running

I have been operating as a small consulting agency for my clients lately. Here is what has been happening:
- Client seeks out my work.
- We begin a working relationship.
- Client needs more work done, so I find another worker.
- I remain point of contact, but bill client for worker's time and my time to get more done.
This is pretty simple, but works out well. The client only needs to go through one channel of communication does not have to worry about the work getting done, because I can hire up for what the client needs.
The truth is, most clients are not able to find the right people to work with. Since I have worked both in corporations and also in open source, I know a strong network of people. This also saves the client overhead of finding the right people for the job. They can rely on the work that I will deliver.
This has been a great shift of focus and I am privileged to be providing people jobs through my clients while being able to deliver more work than before.
Top Commenters Page
An addition to my website is the top commenters page. Even though the page doesn't look that complex, there is still a bit going on behind the scenes.
To get the top commenter count I have to thank Ryan Peterson in helping me write this custom MySQL query. I used Group By to lump the results together based on the commenter's email address. Then use count(*) to count the number of records in the group. Also used the NOT function in MySQL to filter my email address.
Mysql:
SELECT `Comment`.`author`, `Comment`.`id`, `Comment`.`url`, count(*) AS `count` FROM `cake_comments` AS `Comment` WHERE 1 = 1 AND NOT(`Comment`.`email`=\'m@marcgrabanski.com\') GROUP BY `Comment`.`email` ORDER BY `count` DESC LIMIT 0, 10Since I didn't want to load all of the related comments at once, I decied to use a little jQuery and Ajax to show comments that they have made.
First, I put a
spantag around the comment count, because without JavaScript you won't see this functionality. On page load I swapped the spans into links with$(this).replaceWith('<a>' + $(this).html() + '</a>');Instead adding behavior later after append, I used a jQuery object inside
replaceWithso I can attach behavior to the link and I like how the code looks.JavaScript:
$(this).replaceWith( $('<a>' + $(this).html() + '</a>').click(function(){ //code here }) );Using CakePHP's JavaScript object generator,
$javascript->object($data);it was easy to send JSON back to the client and parse with jQuery. Here is the full source of the JavaScript file.JavaScript:
$(document).ready(function(){ $('.get_comments').each(function(){ $(this).replaceWith( $('<a>'+$(this).html()+'</a>').click(function(){ link = $(this); $.post('comments/get/comments', { 'data[Comment][id]': $(this).siblings('.author').attr('id') }, function(data){ out = ''; for (i in data) { prefix = data[i].Article.type ? 'article/' : 'answers/'; out += '<li><a href="' + prefix + data[i].Article.slug + '#c' + data[i].Comment.id + '">' + data[i].Article.title + '</a>' + data[i].Comment.created + '</li>'; } $('<ol>' + out + '</ol>').hide().appendTo(link.parents('li:first')).slideDown(); $(link).replaceWith( $(link).html() ); }, 'json'); }) ); }); });
Update: I think I'll post the CakePHP code just in case someone is interested. Here is the controller, I use the RequestHandler component
var $components = array('RequestHandler');and the Time helpervar $helpers = array('Time');in the top of the controller.
PHP:
function get($type = null) { if ($this->RequestHandler->isAjax()) { Configure::write('debug', 0); if ($type == 'comments') { 'fields' => 'Article.title, Article.slug, Article.type, Comment.id, Comment.created' )); } } }I also turn debug off with
Configure::write('debug', 0);. Also, I only use$typeso that I can setup my code to get types of data if I want later - more of a design pattern I typically follow.Then in my view I use the time helper and output a JSON object.
PHP:
<?php if ($result): $results[$key]['Comment']['created'] = $time->timeAgoInWords($result['Comment']['created']); endif; endforeach; ?>
To see in action, click the comments count next to someone's name on the top commenters page.
Four Types of Web Developers, Which are You?
After years of working with developers and observing motivations - it seems I've generalized people into a few categories.
Please don't balk if they aren't 100% accurate, since everyone is different it is hard to generalize - but this shows the general trends I see of paths people follow when devleoping for the web.
Type A: Developers for Developers
The core of the coding world. They have philosophical debates about code with each other. From this group of people came all the programming languages ( C++, PHP, Java, Ruby, etc ). If they have any people skills at all you will see them leading conferences and in the lime-light. Otherwise you can find them in password protected MIRC channels and in the deep dark caverns of corporations where no business person has ever step foot.
Type B: Developers for Client-Developers
They build plugins, frameworks and tools for themselves and fellow developers. The focus is on developing bits of reusable code to accomplish client work more efficiently. In the marketplace some are self-employeed, yet most of these people occupying full-time positions as team leads (or normal developers who exceed employer expectations). Their philisophical debates are found to be mostly around what are the best tools to use, but also on how to write the best code. Community activity is high - as most have blogs, comment regularly on blogs and attend conferences.
Type C: Client-Developers
These developers use out-of-the-box software packages and slightly modifies them to get client work done. Their focus is on doing what the boss or client tells them for the day. May listen to podcasts, or participate in community lightly via blog comments or in-frequently posted to blog hosted at Blogger.com. Will only attend a conference if it is local and 100% paid for. In the marketplace you will find them working 40 hour weeks. Prime motivating factor is family and job security.
Type D: Developers for Money
These people are hack'n'mash, "developers". You will find them grabbing dreamweaver or any WYSWYG tool to, "make a million" via affiliate programs and any idea they can get their hands on to make money. Visit their sites and see all types of ads - link ads, popup ads, pop-under ads (though some are finding smarter methods). Products are being sold because they understand the human condition and feed desire into a sale (conversion).
What type of devleoper are you? I am definitely type B.
Business Cards
After getting tired of not having business cards when people asked, I decided to buckle down and make some.
I sent the design over to www.overnightprints.com to get them printed. They turned out exactly how I wanted them - A+ print job by my standards. These cards turned out great!
It is exciting to have some business cards that are this nice. No more writing my email address on a napkin!!
List of Personal Projects as of August, 2008
A list of what personal projects I have going on.
- Rent Update - Rental property listing web application - I have high hopes for this project.
Status: Well-Underway - backend data entry developed, design complete, UI development started.
- jQuery Datepicker v4 - Rewriting jQuery datepicker on top of the jQuery UI core.
Status: Started - initial code structure is complete.
- CakePHP jQuery Integration - Integrating jQuery and jQuery UI into the core of CakePHP.
Status: Concept - digging into current code. Thinking ways to integrate helpers to follow jQuery mindset.
- Carcassonne Online - Board game converted to JavaScript on top of jQuery UI and Comet.
Status: Underway - much of the game interaction has been developed, some difficult parts left.
- Family Reminder - Web application to help those of us with bad memories to list family events and birthdays, members of a family can subscribe to reminders and get invitations, address where to send cards, etc.
Status: Started - database structure and concept complete.
- Open Ad Sense - Open source ad system which gives more ad revenue to publishers instead of Google/Yahoo taking most of it.
Status: Concept - industry professionals are excited about the concept after I explain it.
These are all unpaid (at the moment) and for my own personal career development.





