PhantomJS on SmartOS

So I’ve been playing around with Joyent’s Smart Data Center for a few days and so far it’s been a very positive experience. Today I was deploying a test app when bang! > phantomjs@1.9.17 install /root/releases/web/node_modules/haribo/node_modules/phantomjs > node install.js Unexpected platform or architecture: sunos x64 Silly me I didn’t remember I was depending on phantomjs, […]

CouchDB on Joyent Smart Data Center

Over the last few weeks I have been exploring Joyent’s Smart Data Center as an alternative to AWS. I mainly run node.js apps these days, so I feel naturally inclined to try out Joyent’s platform. But before diving into all the node.js goodness, I wanted to check out their command line tool (smartdc) and familiarise […]

Parsing domain names in node.js and the browser

Parsing domain names in a useful way is a bitch. Top level domains have lots of exceptions and weird rules that are imposible to reflect in a sensible regular expression. The only reliable way of approaching this is using a regularly updated list of all known public suffixes and their basic rules. Thankfully, the Mozilla […]

Running nodejs 0.8.x (or any other version) on OpenShift

This week I had a quick look at Red Hat’s OpenShift platform. After a very good first impression I decided to create a sort of “hello world” node app to see the gears in motion. So I look around…. cartdriges… and voila! There it is, nodejs… but its 0.6… hmmm… scroll down a bit more… […]

jQuery plugin to fetch tweets using the Twitter JSON API

Over a year ago I posted a script showing how you could fetch tweets using jQuery and Twitter’s JSON API, and to my surprise it has had a decent amount of traffic. So now that I’ve been learning more JavaScript and jQuery I decided to re-write the script as a jQuery plugin. The plugin allows […]

Building a town/country picker using Google’s Geocoding API and jQuery

I’m currently working on a new “social” site for a startup and when building some of the forms, one of the bits of information we need to collect from users is their country and town or city. Nothing really new, but I didn’t want to build an enormous dropdown with every country in the world […]

Installing PHP’s OAuth PECL extension on Mac OS X Snow Leopard

I recently reinstalled the operating system on my Macbook and this time around I decided to use homebrew to manage packages. Since php comes pre-installed with OS X and homebrew encourages using the pre-installed binaries, I have been using the built-in install of php, and so far so good. But today I tried to install […]

Using JavaScript closures to create private scopes

One of the best known problems in JavaScript is it’s dependance on a global scope, which basically means that any variables you declare outside of a function live in the same name space: the ominous window object. Because of the nature of web pages, many scripts from differnt sources can (and will) run on the […]