Dan Glegg - Software created, Inventions made to order

Recently shipped

Most recent post

Javascript doesn’t make dealing with structured data easy at all. Even when you’re working with data you control, you’re having to put filthy, nasty null checks and do-while descent loops everywhere. When the data is out of your control, such as data pulled from some external JSON(P) API, the problem can become more severe.

To scratch my own itch in this regard, I’ve created SpahQL, a query language and data manipulation library for dealing with Javascript objects.

To use it, all you need do is ask SpahQL to create a database wrapping your object:

Older posts

I’m trying something new. Call it an Automated Negative Reinforcement Procrastination Embarrassment Engine. The ANRPEE is a device situated at the very top of my personal site, serving a number of purposes.

One, it gives me somewhere to update the status of any work in progress projects without spamming Twitter and without turning the blog feed itself into a commit log.

Two, it sits there. Looking at me. Staring. Judging. Why haven’t you updated me? Why haven’t you officially released this thing that I am sat here, very publicly announcing to be a work in progress, when in fact you finished it weeks ago? Why haven’t you shaved? Look at you, sat in your filthy man-cave. Update me, you disgusting hipster. Make me an accurate representation of the state of your projects.

You asked for it, I needed it as well, so here it is. Nav.js now supports multiple documents as well as the classic single-document use case.

Nav.js in multidoc mode

A few things have changed. Firstly, there’s now just a single nav element containing h3 elements as categories, and h4 elements as documents. By default, Nav.js will add the document overview immediately after the first nav h4.current. Secondly, initialisation is cleaner. Nav.init is called with a callback function. The callback function receives the generated document overview as an argument. You put it where you like.

Screenshot of Nav.js in use

I’ve just pushed to Github a small tool that I’ve been using internally for making long documents more readable. Here’s the problem:

  • Github expects a README to display on the front page
  • Some projects have very long README files
  • Long documents are a pain to navigate

So Nav.js is a Javascript hack to give long documents a nice, readable overview which follows the user around the page and has some nice tricks like popping open sub-sections as the user scrolls into them.

If you want to know what it looks like, here’s a live demo of Nav.js being used in another project I have in...

I recently gave a presentation to my colleagues at Videojuicer about HTML5 and what it means for our business and our technology roadmap. Being a mindless sheep, I did of course opt to create the presentation itself in HTML5 with the intention of having the audience follow along in their browsers, without the aid of a projector.

Then, a thought occurred.