Tipsy gets benchmarked against other popular PHP frameworks. Acording to these tests, Tipsy is the fastest extension-free framework (both phalcon and ice require compiled PHP C extensions to work).

PHP Framework Benchmark

Tipsy v0.10.3

New Tipsy, new sample code.

With the latest release of Tipsy we get performance improvments, PostgreSQL support, and a bunch of easily deployable examples, including Hello World, Blog Example, and Beer Squirrel.

Take a look at all examples at Examples.

The release of Tipsy (MVW PHP)

Over the last decade I have modified and released several different PHP frameworks, with each version changing as my style changes. This new framework, created almost from scratch for some of my newer, smaller sites, focuses on speed of development, with the idea of making REST based web apps super easy to build.

This new version has been named Tipsy, because, obviously, I made it…and everything else…while drinking.

Tipsy is an MVW (Model View Whatever) framework, following the examples of AngularJS.

Heres a quick example of how easy, yet how powerful and lightweight, Tipsy is:


require_once 'Tipsy.php';
use Tipsy\Tipsy;

$tipsy = new Tipsy;

    ->when('hello', function($Scope, $View) {
        $Scope->user = 'Devin';
    ->otherwise(function() {
        echo '404';



<h1>Welcome, <?=$user?>!</h1>

Take a look at the source, examples, and documentation, over at Tipsy’s Github Repo.

Learn to build an application using Angular.js

How awesome would it be if there was a short online class on how to build an application using Angular? O wait there already is. Check it out.

I've moved to tumblr!

After nearly 18 years of building and managing my own website using nothing but a text editor and scratch code, I’ve decided to build on top of an existing platform for once.

Tumblrs custom themes are ridiculously simple to modify so that each page can display each type of data nice and pretty.

Maybe now I will write posts more often than once every year…

I fucking love AngularJS. I fucking love Cana.

About a year ago I started a personal project called droplet that is basically a shared photo library social network (for people who have friends). It was my test to learn AngularJS. I fucking hated it. The documentation was absolutely awful, wrong at least half of the time. Or the docs reflect some crazy version that never even made it to main repo. It was a complete fucking mess, and that is what I expected.

The fact that it was a fuckshow actually made it MORE fun to learn. So I built this silly little app in 2 days, and decided I had enough knowledge to switch our entire company, Crunchbutton, away from my scratch built JS framework to Angular. I was wrong. But not in a bad way.

Over the course of the next couple days, i converted what was basically jQuery and a backbone (for templates ONLY) MVC framework and turned it into Angular…for the most part. I got seriously tired of all the broken shit, or people claiming this piece of code works, or whatever, and it just – not – working. So I had my developer partner, Daniel, do all the hard stuff! And hard stuff he did. He converted all of my half finished code into pretty angular directives and fixed all the junk I broke. He was my savior.

A couple weeks go by, and we are ready for live. It was awesome, but in reality at the time it was nothing more than a framework change, and a messy one at that. It took us both a while to finish cleaning things up and angularify everything. Soon after, we pushed our app to the iOS store. Yay! But thats not what this post is about.

The app has been in the store for just over a month, and since then I have COMPLETELY redone the UI and design. I spent countless drunk hours designing all the new stuff without touching any code, trying to make sure every pixel was perfect. Well…its fucking perfect.

So let me get to the point:

Without changing more than a dozen lines of code (adding directives), I have built an entire new ui ON TOP of our existing theme, that functions different due to how easy it is to bind functionality to Angular within HTML and HTML that changes.

That about sums it up. So let me explain quickly how and why things are so easy.

We use Cana. Cana is my PHP framework. Hand crafted. Aged for 12 years. This is my sipping whiskey.

Cana has the ability to configure sites, or apps, with a config array to change the include paths in a cascading manner that allows us to create sub templates for ONLY files that have changed compare to the parent. Heres what I mean:

  • active themes configuration is [“sexy”,“old”]
  • old theme has 15 files, including home.phtml
  • sexy theme only has layout.phtml and home.phtml
  • when the request is made to the server, it cascades downwards automatically to include all of the templates needed
  • this works for views, controllers, and models
  • did i mention there phtml so we can pre process them? :p

Now, when a request is made to the server for a page, it bundles all view files required for angular in the initial request by parsing the layout templates tags.

So in the end, what we have is a system that allows me to edit ONLY the html files I need to create a whole new theme, with new functionality thanks to the power of AngularJS. This is something I did not expect when we first switched.

Being able to develop this theme on the same code line as our primary code is absolutely amazing. It saves us time with branching/merging, and lets us test our code out in the wild where we never would.

Thanks AngularJS. Thanks Cana.

Curious on how I build the views? Take a look at (or if you are feeling adventurous or shoot me an email from my ME page.

Disable smart quotes in OSX Mavericks

Windows and Word users have always driven me crazy when they complain about crazy characters in their posts or pages…and the cause is almost always smart quotes or dashes. With the release of OSX Mavericks, we too now have the misfortune of smart quotes. Smart quotes are those little angled quotes that point to your content. Like:

“Smart double quotes.”          "Dumb double quotes."
‘Smart single quotes’           'Dumb single quotes'

If you are pasting things back and forth between people and someone has crazy encoding settings, or isn’t using UTF-8, those characters can get all crazy, and not show up properly. Especially when pasting them straight into a database.

So, lets disable them!

To do so in OSX Mavericks:

  1. Open System Preferences from Applications or Launchpad or wherever.
  2. Go to Keyboard
  3. Go to the Text tab
  4. Uncheck Use smart quotes and dashes.

If you are using TextEdit, you will also need to:

  1. Open TextEdit
  2. In the top menu, go to TextEdit > Preferences
  3. Uncheck both Smart quotes and Smart dashes


Reading google+ API feeds into your blog with PHP

Today I get this lovely email from google telling me all about the availability of the new Google+ Platform API. So naturally I have to check it out! For a while I have been using facebook and twitter feeds as simplistic blogs for some of my sites, but for my personal site, I would love to just use Google+.

I’ve created a simple example of how to setup and read your own public Google+ feeds.

Enabling API access and getting your API Key

  1. Head over to the APIs Console.
  2. Select Services
  3. Enable the Google+ API services. Without this you will not be able to access your feeds.
  4. Select API Access
  5. Under Simple API Access, grab your API Key. Hang onto this as we will need it to access any of the API services.

Getting your Google+ ID

If you don’t already know where this is located, head on over to Google+, click on your image in the upper right, and click Profile. In the address bar, it will now have a link like

Accessing your activity stream

Now that you have your ID and Key, you can go to the url of your stream. Your stream URL will look like this[API Key]

Parsing this stuff in PHP

Thankfully all the responses are in JSON which makes it really easy to read the data. Each item is inside of items.

$id = '106670447018211124292';
$key = 'YOUR KEY HERE';
$feed = json_decode(file_get_contents(''.$id.'/activities/public?key='.$key));

foreach ($feed->items as $item) {
  echo '<h2>'.$item->title.'</h2>'
    .'<i>'.date('F jS Y @ H:i:s',strtotime($item->published)).'</i>'
    .'<br /><br />';

And now we can access our public junk! This feed contains some additional information other than just the title and content. Like if you entered a url, it will attach the url to it inside of object.

Terminal skipping while editing files over SSH in OSX Lion

So since I installed OSX Lion ive been having this crazy issue where editing a file in nano or vi would sometimes skip characters, or shuffle them around, particularly when I hit backspace. I would then save the file and open it and it would look nothing like what i entered. There is a solution!

  1. Go to Terminal > Preferences
  2. Go to Advanced
  3. Change the Declare terminal as: from xterm-256color to xterm-color

yay! I only has this issue while editing my CentOS boxes as that all i have anymore.

Monitoring site errors using Server Density and Python

I recently stumbled upon the site Server Density while upgrading all my servers and signed up for the service. It as a great pretty interface, a customizable dashboard, and pretty extensive alert capabilities. They also have a free trial so I suggest signing up. The one thing I did not like was the inability to scan for a specific string on the website to confirm if the website is still operational, like with

The good news is Server Density allows you to create python plugins to run at the update interval on any/all of your servers. This gives you free reign over your reports. Using this tutorial, I will explain how to manually create and install this and any other plugin. Or you can just download or install it from the below links.

GitHub -

Server Density Plugin -

Create your plugin

First, log into your SD account and go to Plugins. Then add a new plugin and name it WebCheck.

Add your plugin to your server

Next you will need to ssh into your server and create the directory

mkdir /usr/bin/sd-agent/plugins/

In that directory, create a new file called This will be the main and only file for the plugin. Grab the code from and paste it into the file.

Configure your plugin

If this is your first plugin, you will need to add your plugin directory to your plugin config file. Open up /etc/sd-agent/config.cfg and replace the plugin_directory line with

plugin_directory: /usr/bin/sd-agent/plugins

WebCheck allows you to check the status of as many sites as you want. In order to check they you will need to enter a new config entry for each site, using the below fields:

  • name - The name and key you want to use on the SD interface. Remember that all “.” will be replaced with “_” due to api limitations.
  • url -
  • find - The regex or string to search for. I typically just use an html tag but you can search for anything.
  • result - The result is the regex quantifier. Lets say you want to search from </html>, you would keep this True. Or lets say you want to search for Parse Error, you would then make this False.

Here is an example config entry

[WebCheck 1]
find: </html>
result: True

Restart the agent service to load the changes. Once it is restart it will begin sending data to SD

/etc/init.d/sd-agent restart

Settings up alerts

Because WebCheck only returns a boolean result, you probably wont be using it with graphs much. The alerts, however, are extremely useful. I personally recommend the iPhone push notifications, as they are uber fast.

  1. In your Server Density account, go to Alerts and click add new alert.
  2. Select your server that you installed it on, who is going to get it, and the alert type.
  3. For Check, select WebCheck.
  4. For Key, enter the name of your config entry. For me it is devin_la.
  5. For Trigger threshold, set it to Less than 1.
  6. Add it and you now know when your server is messed!

I love it!

One of my developers was working on a site and pushed some naughty changes to one of the sites I had just set up with this, and within seconds i got a push notification that it was broken. He fixed it pretty quick and it then alerted me when it was all fixed! Please share your cool plugins with me!