Category: Code

Tracking runners without draining their phone battery

Running a GPS unit on a phone drains your battery quickly with all the work it has to do (measurement reports, transmission alongside your normal apps), when you are going to be running for a LONG time you need to think outside the box!

(more…)

Laravel join overwriting field names

It’s a really common thing to do with databases, join a tables with an other table, but when you have two models that have a field with the same name by default one will overwrite the other!

(more…)

Tinkering the cPanel Backup System

The backup system in cPanel doesn’t do exactly what we want, it does the job pretty well but you can’t set schedules of who wants daily backups and who wants weekly and still handle all the retentions that some hosts need.

(more…)

CloudLinux Selector Script to detect PHP version selected

This is odd, my last two blog posts have been about bash scripting, not because it’s something I’m good at or do a lot, but because when I achieve something with it – I want to remember it and am quite proud of it!

In this case CloudLinux gives us a PHP selector but no user interface for checking the version, it’s all command line, but on a per user basis.

(more…)

PHP Bank Holidays, mainly Easter!

PHP

I need to calculate bank holidays in the UK as part of a project I’m working on. You might think this would be easy, but then you realise that Easter moves, Christmas and Boxing Day bank holidays rollover if they fall on a weekend etc.
(more…)

Building a Javascript Embedded Widget

As primarily an API / backend coder in recent years I’ve always thought that Javascript looks amazing when it works (and making it work when it seems such an ambiguous language is half the battle). However, recently I’ve had reason to write a lot more Javascript (and learn a lot along the way!), let’s start with the widget I’ve built.
(more…)