Posted on

are you a logger?

Some people are debuggers.
Stepping their way through the binary jungle, one hack at a time.

For those of you who are loggers, staring  at the console for interesting events:
I had some time to write a small php script that will put a console.log for every method in a canjs controller.

Should save me loads of monotony when reverse engineering OPC ( other peoples code ).

Hope you find it useful:

<?php

if( !isset( $argv[1] ) )
$argv[1] = 'Storage.js';

$fileInfo = pathinfo( $argv[1] );
$outFile = $fileInfo['dirname'] . '/' . $fileInfo['filename'] . '_debug.' . $fileInfo['extension'];

$in = fopen($argv[1], 'r');
$out = fopen($outFile, 'w');

while( !feof( $in ) ){
$line = fgets($in);
if( preg_match('/:\W+function/', $line)){
preg_match("/\((.*)\)/", $line, $matches);
$function = explode(':', $line );
$functionName = trim($function[0]);

if( isset( $matches[1] ) && strlen($matches[1]) > 0  )
$line .= "\nconsole.log( '$fileInfo[filename]', '$functionName', $matches[1] )\n";
else
$line .= "\nconsole.log( '$fileInfo[filename]', '$functionName' )\n";
}
fputs($out, $line);
}

fclose($in);
fclose($out);

Posted on

Real Web Developers don’t do “Builds”

I don’t want to wait for some MAVEN command to execute.
I just want to refresh the browser!

So this is where Charles Proxy comes to the rescue!
The “Map to Local” feature allows you to quickly map your resources to a live implementation on a production, or development environment.

Really great feature, that saves a lot of time. Even the uploading to a generic hosting step can be skipped when doing changes to static resources. So this tool is good for Enterprises and SMBs.

Usually I would completely avoid extraneous non open source solutions. The KISS principle is something I apply not just to my coding, but to my workflow as well. Unfortunately, I don’t always get to decide what platform and workflow structure I have to interact with. And this where tools like Fiddler and Charles become indispensable in preserving my sanity.

While on the Mac environment, I am currently using Charles Proxy, Fiddler2 also provides this feature, hidden in the AutoResponder tab. Simply activate “Map URLs to local files”. And Fiddler should be able to run on Linux / Mac, although I haven’t tried it yet.

Check it out http://www.fiddler2.com/fiddler/help/video/default.asp

Posted on

Mobile Web

Today I had the pleasure of meeting Maximiliano Firtman. An amazing speaker who kept my attention the entire time.
He really validated my perspective on mobile web. That even though it’s a complete fuster cluck when it comes to devices, screens, features, and may be an exercise in complete futility because as soon as your done coding everything is going to change anyway, you still can’t idly sit back and do nothing.

Though many of my co-workers were joking that his talk made them depressed about the current state of the mobile web, I really found it enjoyable, because he echoed back many of my own viewpoints regarding Responsive Web Design, system architecture, and even how job duties or roles should be defined. And since great minds think alike, I recommend you check out his books. They will reveal lots of great resources. And illuminate niches in capturing users, and getting a better ROI, when it comes to creating a mobile version of your website.

Spoiler alert, there is no easy way to go about creating a mobile version of your site. And as craftsmen, we have to first painstakingly measure, and remeasure, before we put our tools to work. Keep in mind, this gentleman has been doing web programming since 1995, and has been a subject matter expert in mobile web design since 2000, during the days of WML, and WAP.

Posted on

Innovation through Miscommunication

Funny story right. A friend of mine is working with some interesting people right, and he tells me about this graphic/web designer, who was asked to make a drop down during the daily standup. So my friend is telling me about how he is doing a total facepalm cause this guy is estimating the addition of a drop down as an eight hour task, right. I mean, that was all that was there, find a space on the page, design a niche spot in photoshop maybe, where this drop down will go nicely and contain some hard coded values. I gotta say, I agree with my buddy cause you think drop down you think select tag. Bada bing Bada boom. Heck the wireframe had a freaking select tag based drop down in it. But apparently the designer didn’t quite get it, so it took him a while to even answer back. He took like 5 minutes to make sure what he was supposed to do, looking all confused and the rest of the team totally accepted his estimate. So about 8 hours into his task, it becomes apparent that he is actually making a fly out pane that drops from the top! And my friend tells me its beautiful. With a great design, and nice tween, a great value added to the project.

But who would have thought it, that what someone else might interpret as a miscommunication, is actually innovation!

Posted on

From Bill Maher’s Blog

The Endth Degree

By Bill Maher

Is going to college still even worth it? College grads are coming out with degrees, yes – and herpes – but also with student loan debt totaling $60,000, $80,000, $100,00. These kids haven’t even gotten started in their careers and they’re already saddled with what’s tantamount to a full mortgage. In this sucky economy, graduates find themselves back in their old bedrooms at their parents’ homes, taking jobs in the service industry that they could have gotten without a college degree.

Wouldn’t a bright, industrious kid be better off in this economy to just jump into the job market and try to excel through merit?

[full article]

Posted on

Interviews: Sodahead and Disney

How exciting, I got a 1pm meeting today with Sodahead. I blew my chance to hook up with VC funded start up three years ago. I just didn’t know enough about MVC, and ORM, and Agile Development. The same problem occurred at Disney and Varient.

Varient didn’t like me because I had never seen ->assign(‘name’,$value) statements before. And I totally flunked one of their questions, “Create a left hand menu with 3 random links selected from a database”. I was so amped the night before, and crashing so hard that day, I went into my own world of .. use rnd() and use a loop to get 3 unique id numbers. when the answer was “select * from links order by rand limit 3”.

Sodahead didn’t like me because I didn’t know about Agile Development, or Scrum, and I had no clue what ORM, or object relational mapping is. What was I supposed to say? I mean, we didn’t have main stream frameworks at Bill McCaffrey’s setup, and their servers were getting 2 billion page view’s a month. Bill taught me that the best most efficient way to extend PHP is with C. He also taught me, screw oracle, write your own middleware, in C.

I hope to have changed this precedent, and today I will find out, as I walk into a Django backend and YUI frontend shop, Sodahead.com
And then do a phone screening with Disney.

Manifesto for Agile Software Development

We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

That is, while there is value in the items on
the right, we value the items on the left more.