PHP Scalar Wrappers and Numbers Package

php5.4-300x300I am a huge fan of type hinting in PHP. When using great tools like PHPStorm it gets even better because of the amazing auto-complete and refactoring capabilities the IDE provides. Unfortunately, PHP doesn’t provide type hinting for scalar values. The SPL provides a set of classes for scalars, but they are not very popular. So, the package PHP Scalars (https://github.com/joefallon/PhpScalars) was born.

Read more…

Method Calls in Ruby Class Definitions

rubylangWhen learning Ruby, one of the interesting language features that I came across was the calling of methods within class definitions. When a class has finished loading, the method calls that exist within the class are executed, one after another. The purpose of these method calls is generally to make modifications to the class and change its functionality, although this isn’t necessarily always the case. One of the most common examples of this feature is the attr_accessor method. The ability to modify a class via code execution is very powerful, although somewhat surprising to the new Ruby developer.

Let’s take a look at how this works.

Read more…

Controlling Your Email and Inbox Zero

If you’re like me, then your email Inbox can sometimes get out of control. I have tried several different methods to control my Inbox. For example, I have created sub-folders in my Inbox based on topic or who the email is from.

Step 1

However, this often fails as a solution because there will be emails that don’t fit into a particular folder, or worse, fit into multiple folders. Another method is using sub-folders that are named based upon a temporal scheme such as month, fiscal quarter, or year. Neither of these solutions works in the long term.

Read more…

Install MySQL on Mac OSX using Homebrew

UPDATE: This post is probably very out of date. Please use at your own risk.

mysqlRecently, while doing some development on my Mac, I realized I didn’t have MySQL installed. I could have loaded up an instance of Ubuntu 12.04 LTS on VirtualBox and used that. However, I thought it would be much more convenient to have it available directly instead in a virtualized environment. Here are the instructions for installing it on a Mac using Homebrew.

This guide assumes Homebrew is installed and properly functioning.

Read more…

Getting Things Done Workflow Flowchart

Like most knowledge workers in the world today, I handle a large number of issues, projects, deadlines, and action items. Some are small and some are large. Often, many will be “in-flight” at once.

Several months ago, I began doing some research into the best productivity and organizational methodologies. One that kept popping up was Getting Things Done by David Allen. Within the software development community, it is especially popular. After reading the book, I can see why. The whole process is very logical, straight forward, and lends itself to be diagrammed using a flowchart. The author includes one in his book. Unfortunately, it left many important pieces of information out. Therefore, I am including a much better flowchart here.

Read more…

Access Control vs Authorization

When first learning about the difference between authentication and access control, it may be easy to confuse the two. However, they are two very different concepts. Also, they should understood well by any developer that is writing applications where access to the application needs to be controlled.

Read more…

How to Move a Magento Installation

It is common as a Magento developer to have to move a Magento installation from one location to another. The normal way to move a site is to compress the web directory, dump the database, move the data to the new location, and finally adjust the configuration as needed. Moving a Magento commerce site requires the same general procedure. However, the devil is in the details.

“It’s the little details that are vital. Little things make big things happen.” –John Wooden

Read more…

Why We Are Stuck with Internet Explorer 6

UPDATE: We are no longer stuck with IE6. Yay! 🙂

Among web developers, Internet Explorer 6 is considered a horrible browser. However, amongst many corporations, it is the standard browser that is used throughout the organization. One reason for this is due to the great amount of difficulty for a large organization to change. Every page on the company intranet has to be tested and fixed. Additionally, moving away from Internet Explorer 6 typically involves a change in operating system.

Read more…

N-Tier Model-View-Controller

Overview

The classic MVC (Model-View-Controller) architecture (see Fig. 1) has the View communicating with the Controller and the Model. However, this leads to coupling between the Model and View, View and Controller, and Controller and Model. A case could be made that is a significant amount of coupling. Unfortunately, coupling is the bane of software development. Additionally, coupling makes software hard to change. Instead, an N-Tiered approach to the MVC pattern was created to alleviate the coupling and create a more flexible design.
Read more…

Easy PHP Debugging with PopUp PHP Debugger

If you have doing PHP development for any length of time, then you have ran across the need to perform PHP debugging without the use of a full-blown debugger. In many cases, print_r works fine. However, echoing debugging text to the page will often break the layout. A method was needed that would output text while also not breaking the layout.

To satisfy this constraint PhpPopupDebug was written. Actually, parts of this code was found elsewhere a very long time ago. The original source is no longer known. As it was used, changes to the code were made to make it easier to use and more robust. When a variable is dumped to the output, a JavaScript window is opened in the background with the dumped data. Therefore, no text is visible on the page.