PHP Routing Library

For the past few years, I have been working more and more with Node.js and proportionally less frequently with PHP. As might be expected, though the underpinnings of web behavior is platform agnostic, the architecture for the web application layer changes to suite the technology stack in which you are building. In fact, one of the marks of a savvy engineer is the ability to leverage the best parts of a technology in the way they build their software. However, I found myself spending far too much time trying to relearn techniques in PHP for projects as I came back to them, so I decided to see if I could build a lightweight routing system in PHP that would mirror some of the patterns I use in my Node.js work every day.

Anyone who has worked with Express, Hapi, Django, Rails or even Grails can understand the ease of route declaration with something like this:

Continue reading →

Tracking Room Usage

At work, my team has been working on an extremely intriguing project to see whether or not we could devise a solution to allow us to accurately track the usage of our meeting rooms. The initial project was intended to simply help individual contributors find a currently open space in which to meet with a coworker for an impromptu meeting, but it has grown into much more. As the data has started rolling in, we are discovering the ability to analyze room usage and actually advice facilities management on which areas could stand some additional optimization.


Charted above is an example of the data we have been able to start visualizing. While I cannot share actual internal Disney data, this sampling is  representative of the type of metrics we are gathering. Interestingly enough, when we overlay the data collection with the bookings of the rooms in Outlook, we can start identifying trends with people who might book rooms on recurring schedules but seldom use their allocated time.

Continue reading →

Client Side Testing: a Baseline

Those who well know me and my work understand my passion for coding things right the first time. Take a little extra time to architect something, and you will save yourself hours, days or – in some cases – weeks of development time down the road. What better way to assure your code is meeting your own exacting standards on the client layer than to establish some good testing practices.

In an attempt to aid developers with less testing experience in setup and execution of client testing, I have created a new repository on Github to help with a testing baseline from which each can develop his own processes: Client Testing Baseline.

The only prerequisites is installation of NodeJS. See the README file in the repository for details on what test environments and additional code assistance tools are included.

Triggering True onChange Event for Text Fields

Something I’ve run into on multiple occasions is the desire to be able to trap the change event of text fields and textareas – not just on blur but when their value actually changes. I will assume some basic understanding of how DOM elements behave and that, while the input and textarea nodes have change events, they don’t actually fire in all browsers until you move away from them. This led me to thinking that there has to be a somewhat optimal way to trigger an event on those fields only when their value changes. If you’ve ever tried something like this before, you may have settled for a combination of listening to keypress and keyup events to get your desired behavior across all browsers, but once again, you have to attach this to all. elements on which you wish it to behave. jQuery once again allows us to develop a very simplistic solution in a relatively tiny bit of code:
Continue reading →

WordPress Plugin: Ajax and WYSIWYG Comments

I spent a good bit of time on Google and the WordPress Codex trying to figure out the best way to customize comments to use Ajax for posting. I finally decided to write my own plugin to solve the issue, since there are a lot of ideas but no real concise nor comprehensive solutions that worked across the board. Additionally, I wanted to offer the capability of using a custom version of the built-in WYSIWYG editor (TinyMCE) to users for comment modification as well. If you have some time to check it out and leave me some feedback, I would appreciate the input!

Custom Google Voice Widget Creation

If you use Google Voice, you may be familiar with the option of creating widgets that you can place on your website which allow people to enter their phone number and request to be connected to your Google Voice number. There are several benefits to this type of behavior, but the best of these is that you can offer people the opportunity to call you without ever publicly displaying your phone number. What’s more, each new widget creates a unique buttonId associated with it that allows you to record a custom voicemail response for users of that widget.

Of course, the downside to use of the widget system is that it is not customizable at all, and it is only available in the form of a rather large Flash button to place on your site. After some digging and research, I finally figured out how to post requests to your unique buttonId via standard HTML forms. Taking this to the next level (and much more usable, I might add) lets us create a manual Ajax handler that will make our request to connect the user without ever leaving our page.
Continue reading →

A Starbucks Conundrum

Something I have noted in my relatively regular visits to Starbucks for my morning dose of goodness-in-a-cup is the nearly overwhelming mispronunciation of the 20oz drink option. As you may or may not be aware, this size designation is a venti, which actually means “20”. We can also see that the pronunciation, as expected, rhymes with tee or bee, but the baristas who serve me inevitably repeat my drink order as a vente instead. I was bothered by this for a while – up until the cleverly disguised sarcasm began to sink in. Wittingly or not, each of these baristas has just confirmed that I indeed had paid for a “wait” with cream, allowing them to take as much time as needed to prepare – since that is what I asked for after all. Kudos to you, Starbucks, for coming up with a naming convention that, however pronounced, will make me happily vente for my venti.

Seahawks, Packers and Refs: Oh, My!

I was one of the stunned Seahawks fans left in a very uncomfortable position after Monday night’s contested win against the Green Bay Packers – excited over the win but with a sour taste over how it went down. If you’re living under a rock somewhere and haven’t heard about the controversy, or if you simply care absolutely nothing for football and are reading this out of sheer boredom, let’s review the tension in the league building up to this climactic altercation.

Back in August the NFL refs union began negotiating with the NFL once again, but as everyone in the football world can tell you, it was too little, too late. The season began with the NFL bringing in inexperienced replacement refs who have been, shall we say, struggling to meet the challenge and call clean games – though in their defense, I’m sure they’re doing the best job they can under the circumstances. Suffice to say that there has been tremendous pressure poured out on these refs, and they have been the focal point of mounting tensions as questionable calls have been piling up during these first few weeks of the season.
Continue reading →

Customer Service is STILL Important

In this day in age, with all the technological advancements from entertainment to dining, many companies seem to lose track of the simple fact that customer service is still important. I know first hand how many companies have (or are) letting the simple principle of “the customer is always right” be slowly outshone by the new principle of “the customer is privileged to do business here.” I worked retail for many years in different venues from shoes to computers, and I saw this slip first-hand when I compared the divergence between what was taught during training and to what standard management expected on the sales floor. Thankfully I now work for a company that still values the customer above all, and though I’m no longer in sales, I have had opportunity to sit with customer service for an entire day and watch first-hand how things are handled – and it makes me proud to work here.
Continue reading →

BackboneJS: Dynamic Override of sync() Method

As with any good solution, there needs to be a valid problem you’re trying to solve. In this case, I ran into a challenge at work and wanted to share the concepts of what I needed to accomplish in case anyone else has run into similar troubles.

I was assigned the task of integrating a new UI with a preexisting backend API, which is really not that big of a deal in and of itself. However, as I wanted to use BackboneJS as our client MVC framework and the API was by no means RESTful nor consistent, I quickly became aware that I would need to manually override the sync() method of nearly every one of my models in order to have things function properly. Again, in and of itself, this is not a problem, but working in an environment where maintenance and change are the rule, I wanted to figure out a way to extract the customization in such a way as to be extremely easy to manage.
Continue reading →