Projects

I've written and released a number of "free software" projects, you can find them listed below.

They're released under a mixture of different free software licences, usually according to the norm for that type of project, for example Perl modules are under the Perl Artistic Licence, whereas Javascript projects are under a Creative Commons "Attribute-Share Alike Licence".

Please examine the individual project pages for specifics.

Also please note that although the projects themselves are freely distributable, the documentation, tutorials and examples on this site are generally not.

Template::Sandbox.pm

Template::Sandbox.pm is a Perl module that lets you process templates in a setting sandboxed from your application.

It's designed to run in a webserver environment, but is entirely application-agnostic. For example, this site is generated by using Template::Sandbox.pm from a command-line script to build static HTML pages.

Template::Benchmark.pm

Template::Benchmark.pm is a Perl module that lets you run a variety of benchmarks across different template engines.

It's designed to let you choose different sets of features, and automatically calculate which template engines support those features.

It uses a plugin framework so that it's easy to make it compatible with additional template systems.

Text::Matrix.pm

Text::Matrix.pm is a specialist table display module for display of matrices of single-character (such as Y/N for yes/no) or short multi-character data against row and column labels that are sufficiently longer that conventional table layouts distort the layout of the data.

The core aim is to base the layout on the tabular data concisely and formated regularly to reflect the terseness of the underlying data, without being forced to compensate for the longer length of the labels for the columns and rows.

Text::Matrix.pm will also optionally split the matrix into several sections based on width of the generated matrix, suitable for display in situations where you don't want external line-wrapping to confuse the layout. (Display on an xterm, cut-n-paste into an email, etc.)

Cache::CacheFactory.pm

Cache::CacheFactory.pm is an attempt to solve the 'subclass hell' of extending Cache::Cache.pm. Rather than create a new subclass for every new combination of features you want, you can write or use policy modules and Cache::CacheFactory.pm assembles a cache to meet your chosen storage, pruning and validity policies.

sgMagnifier.js

sgMagnifier.js is a Javascript library to produce a mouse 'rollover' magnification effect, suitable for use in image gallery navigation.

sgTooltip.js

sgTooltip.js is a Javascript library to produce tooltip hotspots linked to arbitrary numbers of tooltip div elements.

Unlike many Javascript tooltip libraries, this doesn't enforce any requirements in terms of what serves as a hotspot or as a tooltip, there's a many-to-many relationship between hotspots and tooltips, and you need to write no Javascript to use the library.

ajaxTemplate.js

ajaxTemplate.js is a Javascript library to produce a simple rules-driven mini-template processor within your HTML.

The intent is that when writing a page with, for example, a list of entries with an AJAX submit form, you ideally want the design of an entry in the list to be within your server-side template, and not to need constructing programatically in Javascript (let your programmers program and your designers design...)

ajaxTemplate.js lets you embed a 'blank' copy of the entry HTML segment, and do a copy-and-paste with rules-based substitution from within the response handler of your AJAX request, preserving separation of design and functionality, and furthermore keeping the design all in the same place (reusing the same template snippets that produce the populated entries in the list.)

Perl Template Roundup

Perl Template Roundup is a periodic 4-CPU-days run of benchmarks using Template::Benchmark in all manner of permutations and combinations (over 1200 of them) to generate what is hopefully the most exhaustive set of benchmark data for Perl templating systems.

There's pretty charts to make it easier to digest too.

Emacs Flymake

Emacs Flymake is an excellent plugin for Emacs that adds on-the-fly syntax checking for a number of languages.

Originally by Pavel Kobyakov, my fork on GitHub is a replacement for that distributed with Emacs, adding a number of bug fixes including support for limiting the number of parallel invocations of syntax checks and spawning a single timer so that it plays nice with desktop mode, and support for using a temporary directory for the syntax checks rather than the same directory as your source code.

There's also tighter integration with my fork of Emacs Flymake Cursor and my Emacs Flymake PHPCS and Emacs Flymake Perl::Critic projects.

Emacs Flymake Cursor

Emacs Flymake Cursor is a plugin for Emacs that hooks into Emacs Flymake to display details in the message area for the error under the cursor, which is helpful if you're running Emacs in a terminal and don't have mouse support.

Originally by persons unknown, my fork on GitHub is based on the version on EmacsWiki and adds the following features:

  • Customizable delay before the error appears in the minibuffer.

  • Customizable number of errors to display in the minibuffer.

  • Does not overwrite the minibuffer if it's currently in use for user input.

  • Updates message area more consistently as flymake changes state.

  • Turns off when flymake-mode is turned off.

  • Now operates as a minor-mode of its own so you can turn on and off directly.

  • Requires flymake, ensuring a clean byte-compile.

There's also tighter integration with my fork of Emacs Flymake although it also works fine with the standard version of Emacs Flymake bunded with Emacs.

Emacs Flymake PHPCS

Emacs Flymake PHPCS is a plugin for Emacs that hooks Emacs Flymake up to the PHP_CodeSniffer static analysis tool for PHP, providing you with on-the-fly feedback on code syntax, style and other warnings.

If you're familiar with the lint tools for various languages, this is what PHP_CodeSniffer provides.

Emacs Flymake Perl::Critic

Emacs Flymake Perl::Critic is a plugin for Emacs that hooks Emacs Flymake up to the Perl::Critic static analysis tool for Perl, providing you with on-the-fly feedback on code syntax, style and other warnings.

If you're familiar with the lint tools for various languages, this is what Perl::Critic provides.

PHP_Codesniffer-VariableAnalysis

PHP_Codesniffer-VariableAnalysis is a plugin for the PHP_CodeSniffer static analysis tool for PHP, adding static analysis of variable use within your PHP programs.

Features it add include:

  • Detection of unused variables.

  • Detection of undefined variables.

  • Redeclaration of variables.

  • Use of self:: static member variables outside their class.

Warning severity for each of these events can be tailored as can other customization options such as defining your own site list of pass-by-reference functions that can accept undefined variables, or a list of site-specific "junk" variables that are safe to be unused.

© 2009-2011 Sam Graham, unless otherwise noted. All rights reserved.