Blog

OK, I admit, it's not much of a blog, but here are a few of my thoughts, ramblings and code snippets.

Latest Blog Posts

Arduino EEPROM wear leveling using a ring counter

Over the past few weeks I've been playing around with an Ardunio Uno, the plan is to build an IOT (Internet of things) controlled central heating thermostat that doesn't require any re-wiring of the current system.

As part of that system I have the need to store the current thermostat value in the EEPROM memory so that the Arduino can go to sleep and it will be able to read the value back after it wakes up a few minutes later.

Now, the problem is there could potentially be quite a lot of read/write operations on the EEPROM memory and over time there would be a chance that the memory would fail as EEPROM only has a specific lifespan before it starts becoming unreliable.

Results Deck App

After nearly 12 months of development I have finally published my first app to the Google Play store.

Results Deck is an app for Android devices that makes it easy to record, publish and share the results from your sporting events.

YAGS - Yet Another Grid System

I've dabbled in using grid systems for years and usually just opt to write my own that is custom to the project I'm working on. This approach has suited me fairly well while I've been building lots of fixed width sites (it's long story), but as soon as I had a regular need to use fluid layouts I knew I had to make the switch to something a bit smarter as calculating all the percentage width's was too much like hard work and it was just crying out for a little SASS.

Debugging JavaScript applications.

Recently I've been working on a large (for me) JavaScript project that has several levels of nested looping logic. Usually I'd debug this kind of script by using lots of console.log(); commands and then comment them out once I no longer needed them, but having nested loops meant that the number of iterations was in the thousands and even just having one logging command at the lowest level was causing enough messages to be written to the console that it was causing Chrome to hang when opening the inspector.

jquery inlineStyler Plugin

A jQuery plugin for converting CSS styles rules into inline style attributes.

  • Lets you specify which HTML elements are targeted.
  • Lets you specify which CSS style rules get written.
  • Can work on the whole document or just a fragment.
  • Doesn't affect any existing style attributes.
  • Applicable styles are calculated by the browser, so complex selectors, media queries and specificity are all taken care of.
  • Useful when preparing HTML emails for sending to webmail accounts where a stylesheet would normally be stripped out.

PHP and jQuery Validation combined.

This is my PHP validation class, it works together with the excellent jQuery Validation plugin to make validating forms simple.

By writing just one configuration file and using it for both the server-side validation (in PHP) and also for the client-side validation (in jQuery), you can reduce your code duplication, saving you time and keeping your code uncluttered.

Roll Your Own PHP Framework

Building your own PHP framework from scratch can be a great learning experience, not only will it teach you how to use OOP design patterns, but you will be left with a great little framework at the end of it which will be lightweight, easy to customise and will save you time in future projects.

This tutorial aims to answer questions such as why use a framework?, and how can design patterns save me time? It is aimed at the intermediate level web developer who has an understanding of OOP but doesn't yet use it to it's full advantage. In this part we aim to explain some of the ideas that underpin the framework we will build a very basic OOP site using the MVC design pattern.

Future tutorials will expand on this basic structure, and will add lots of other functionality.

Setting up you Local Development Environment

Something every developer should have is a local development environment where you can mess about till your hearts content without the risk of breaking stuff and incurring the wrath of angry clients. So here's a little guide on how to set-up you local development environment on a Windows PC.

Omnium PHP Framework

Omnium is my own PHP Framework, I'm planning on writing a run-through of how it all works in the hope that I can help others. Keep checking back for updates.