It’s a brand new year!

Well, it’s been a new year for a little while actually, but 2013 has been a busy one so far. I’ve been working hard on some interesting things, but I still managed a sneaky skiing trip.

2012 was an awesome year; I welcomed it in rawkus style with my former housemates, and then a few days later, after the hangover had cleared of course, flew my first passengers as a newly qualified pilot!

I went to birthday parties, ate some great food, climbed, and enjoyed the company of some great people. I played Capoeira with my group at the Oxford Olympic Torch event, but otherwise managed to miss the worst of the Olympics by camping in the Czech wilderness followed by some epic climbing in Italy.

I have some big plans in motion for 2013, hopefully I’ll be able to dial up the awesome a few more notches! I want to finally get to grips with a foreign language, and ideally live abroad for a while in the native country. I want to progress my flying career in some way, advance to more complicated aircraft or perhaps do an aerobatic qualification. I intend to see more of the world, and climb more mountains (both figuratively and literally!).

Work wise, I’m working on a few exciting things (some of which will see the light of day really soon). As an FYI, I’m always interested to hear about your projects, especially if you need some technical and strategic muscle to help you!

Lets go!

Over the past few weeks and months I’ve had to cause to write, update and dust off a number of Elgg plugins that I’ve had kicking about. As a good open source citizen I’ve stuck them up on github so others can have a play.

Here they are, in no particular order:

» H5F 1.8

This is an Elgg wrapper around the H5F HTML5 form compatibility library written by Ryan Seddon.

This plugin lets you use handy HTML 5 form extensions like “required” and “placeholder”, as well as some of the new types like <input type=”email” /> in your forms and have them work in older browsers.

» Input Country

Input country is a wrapper around Ben Werdmuller’s phpCountryDropdown tool, and provides a handy dandy country selector input type.

Install this plugin to be able to take advantage of this in your forms.

» Profile Completeness

This plugin provides a view and a widget that displays the completeness of a profile based on the number of fields in the profile that are populated. This list of fields can be extended and modified based on a plugin hook.

I’ve used various incarnations of this plugin now for a number of clients, and since it keeps coming up I’ve tidied it up a bit and stuck it on github.

» Recaptcha

Lastly, here’s an Elgg 1.8 version of a recaptcha plugin I wrote some time ago.

It hooks into the Elgg captcha engine, providing captcha verification for registration and the “request new password” functionality out of the box. It also replaces the input/captcha view.

There are a couple of other recaptcha plugins, but I couldn’t find one which just provided the captcha and nothing else, so here’s mine.

That’s it for now, enjoy!

StatsD, created by Etsy, is a simple Node.JS server that provides powerful way to collect numerous statistics about your web application, and to do so simply and quickly.

At Etsy, they graph everything, which they use to great effect.

Collecting statistics is cool because it gives you hard data about how your software is performing. This in turn gives you powerful analytical tools to dig deep into your code, and find out what’s really going on (especially true when combined with a visualisation tool such as Graphite). It let you see the impact of code or infrastructure changes, and to quickly identify problems. Perhaps most importantly, it is only when armed kind of hard data that you can even begin to grasp at the nettles of code optimisation, growth and scalability.

Introducing StatsD for Elgg

With this in mind, and because I needed to collect some stats for a couple of client projects, I’ve put up on Github the first version of an Elgg statsD module. When installed and configured, this module will interface with a statsd server and collect a whole bunch of statistics from your running Elgg site.

Out of the box the current version of the plugin can log:

  • Events & Hooks (which in turn give you things like user signup events and object creation)
  • Exceptions
  • PHP Errors, Notices and Warnings
  • Elgg popups (system messages and error messages)
  • Database calls
  • Script execution time

In addition you can record your own statistics by making a call to wrapper functions contained in the plugin itself.

All data will be logged into a custom “bucket”, which is by default derived from your Elgg site name. This lets you log statistics from multiple different sites to a common statsd server.

Installation is pretty straightforward once you’ve installed the base infrastructure. Follow the instructions for installing graphite, nodeJS and statsd from the various sites around the internet, and then upload the elgg-statsd plugin to your Elgg site’s mod directory.

Once activated, you can specify the statsd server you wish to log to and configure what statistics you want to record.

Have fun!

» Visit the project on Github…

P.S. If you try and set this up and are seeing errors in your graphite log along the lines of “create() takes at most 5 arguments (6 given)“, then you are likely falling foul of this bug.

My solution was to build Whisper from the latest code in master rather than the stable 0.9.x branch. This worked for me, but of course YMMV.