August 2010

31 Aug

The Best Tool for Web Page Speed Evaluation

in memcached, nginx, performance

It seems that, for me, this is the year of website performance optimization. From working with nginx and a crazy memcached setup to recently deploying a handful of Varnish servers, I have been deeply entrenched in the world of website page speed optimizations.
Side-by-sideSide-by-side

Side-by-side

Side-by-side
27 Aug

Building Homebrew Packages

in homebrew, os x, ruby, twitter

ttytterttytterRecently I have been using Homebrew to install Open Source tools on my Mac. I find it to be a little more to my taste than MacPorts. But when I wanted to install TTYtter, a small Twitter command-line client, I discovered that Homebrew doesn't yet have a package for TTYtter.

After a quick chat with JohnAlbin, I decided to try building my own Homebrew formula for TTYtter. John has also successfully built a homebrew package or two. He re-assured me that learning the system wasn't going to require a huge investment of my time.

Fifteen minutes later, I committed my new script to the project, and it is now being considered for inclusion in Homebrew's repository. And almost all of the heavy lifting is done by the homebrew toolchain and git.

How easy was it? Well... I simply followed the directions, and moments later had this recipe:

ttytter

ttytter
26 Aug

Data URLs and QueryPath: How to embed images into XML or HTML

in dataurl, html, php, programming, querypath

QueryPath 2.1 is adding support for writing files directly into URLs using Data URLs. What this means is that you can encode and embed images or other documents straight into your HTML or XML.

Here's a simple example from the QueryPath 2.1 unit tests:

<?php
$xml = '<?xml version="1.0"?><root><item/></root>';
qp($xml, 'item')->dataURL('secret', 'Hi!', 'text/plain');
?>

The above will generate an XML fragment that looks like this:

<?xml version="1.0"?>
<root>
  <item secret="data:text/plain;base64,SGkh"/>
</root>

The important part there is the attribute secret="data:text/plain;base64,SGkh. This attribute includes an embedded text document with the contents Hi!. What we've done is encode the data and injected it as a document inside of the XML.

Sure, that's novel... but what would we want to use that for? How about adding images directly into a document?

Data URL image embedded with QueryPath

Data URL image embedded with QueryPath
26 Aug

Reflections on Google Summer of Code

in drupal, google, gsoc, querypath, quiz

This was the second year that I have been involved as a mentor for Google's Summer of Code program. And in both cases, I've worked as a mentor for Drupal. Last year, I worked with sivaji on a project involving the Quiz module. This year, I worked with eabrand on QueryPath and the QueryPath module.

In both cases, the projects were highly successful. I'm thrilled to have had the opportunity to work with two very gifted up-and-coming developers.

I think one of the most critical questions to ask of any program like GSOC, is whether or not it produces the results (pedagogical and professional) that it is after. With both Sivaji and Emily, the answer is a resounding yes.

  • Since finishing his GSOC project, Sivaji has begun his professional life as a web developer focused on Drupal. Recently, he and his colleagues started E-ndicus, a Drupal-focused software development company in his home town of Chennai.
  • Emily is now a software engineer at HP. She continues to contribute to QueryPath, and was just this week featured on Google's blog. Last week, she joined me on the Drupal Dojo QueryPath session, too.

I doubt either of these individuals learned much from me during our GSOC projects. More than anything, it just takes hard work, persistence, and attention to detail to finish a GSOC project. But I've certainly learned a lot from them. And both Quiz and QueryPath have benefited enormously from the work of these two.

26 Aug

Compiling varnishstat, varnishtop, and varnishhist

in system administration, varnish

I noticed recently that on one of my Debian systems, my installation of varnish did not have any of its monitoring utilities installed. /usr/local/bin was missing varnishstat, varnishtop, varnishhist, and varnishsizes.

I re-ran configure and make a couple of times. I couldn't find any errors, yet none of these programs was ever compiled.

18 Aug

Building PHP from Source on Ubuntu

in Debian, phc, php, programming, ubuntu

This article describes how to build PHP from source on Ubuntu. I am doing this because I need to build PHP with the embeded SAPI -- an option not available by default. For my purposes, I don't want this PHP to replace the existing PHP. Instead, I want it to be available alongside my normal PHP. So the goal is to place this version in /usr/local/php-opt.

18 Aug

Slides for my Dojo presentation: "QueryPath: It's like PHP jQuery in Drupal!"

in querypath

I posted the slides from yesterday's Drupal Dojo presentation. These should be much more readable than the video feed.

16 Aug

Drupal Dojo: "QueryPath: It's like PHP jQuery in Drupal!"

in drupal, gsoc, programming, querypath

On August 17th at 12pm EDT (9AM PDT), I will be doing the Drupal Dojo session, "QueryPath: It's like PHP jQuery in Drupal!". To sign up, head over to the webinar signup.

I'm particularly excited about this for three reasons:

  1. Emily will be joining me to talk about her GSoC project.
  2. We will be discussing QueryPath 2.1 and the new Drupal 7 QueryPath module.
  3. The totally gorgeous new QueryPath logo (designed by Michael Mesker) will be unveiled.

This has been an exciting summer for QueryPath, and this webinar will preview many of the QueryPath technologies that are on the cusp of being released.

08 Aug

"Never Use $_GET Again" at PHP|Architect

in php, programming

I've been fairly silent for the last few months. A vacation, a business trip, and a huge job change have been the primary factors. There's also a big make-over going on with QueryPath right now. With a Summer of Code project promising to bring new features to QueryPath, and a new logo to give it a fresh look, I am scrambling to bring everything to fruition early next month.

But I haven't been totally silent. Here's a recent article I wrote for PHP Architect: Never Use $_GET Again.

08 Aug

A PHP jQuery Library: QueryPath Overview

in javascript, jquery, php, programming, querypath

jQuery is a JavaScript library for efficiently working with HTML and CSS. Its chainable and compact API has made it a popular choice for web developers seeking to quickly build rich web applications. But did you know there is a PHP jQuery library? QueryPath is a PHP implementation of jQuery's interface. It provides all of the DOM manipulation functions, a full CSS selector engine, and as much of jQuery's other features as is practically implemented server-side. But that's not all. This powerful library delivers many server-side features designed to make working with XML services simple, robust, and reliable.