Toggle sidebar

Peter Anderson

Christian - Husband & Father - Web Developer

Svalbard

It all started when I was eating breakfast one morning. I looked over the top of my breakfast bowl at the world map on the placemat I was using (we have a 3 year-old, so we have 'educational' placemats). I noticed a collection of islands to the north of Europe, and I wondered what they were. Greenland looks huge (though it's not really) and was clearly labelled, and I knew Iceland was the small island to its south-east, but I didn't know what these other islands were or who they belonged to. So I investigated!

World map

It turns out that this archipelago is called 'Svalbard' and is part of Norway (...

Finding when a change was made in GitHub

I was recently going through some old bug reports for Backdrop CMS and I came across one that I discovered had since been fixed, though the issue was still open. Rather than just closing it, I wanted to post a link to the commit that fixed it (for posterity), so I went looking in GitHub for when the change to the file in question was made...

The file was views_handler_filter_term_node_tid.inc in the core Taxonomy module, and on line 129 I could see the code that had been a problem but was now fixed:

Line 129

To see when it was fixed, I did the following:

  • Clicked on the line number - it was...

Creating a node programatically in Backdrop

For a Backdrop CMS site I'm currently working on, I needed to create a node programatically (i.e. via some PHP code, as opposed to the UI). Generally when I need to do something in Backdrop, I'll search for similar solutions in Drupal 7 and then migrate them over (Backdrop still has some catching up to do in the 'online help and tutorials' department; hence this blog post).

So I went looking for how to create nodes programatically in Drupal 7, and there were plently of results. The answer is basically to create an object or array of values (your 'node'), then run it through node_save()....

A 'Game of Thrones' Maths Puzzle

Four prisoners escape from the dungeons at King's Landing and head for the Wall; a distance of 700 leagues. The Maester travels 1 league in the first day, then each subsequent day, doubles the distance he travelled the previous day. The Whore travels 50 leagues each day. The Knight travels 80 leagues each day, and 20 leagues each night. The Squire travels 350 leagues the first day, then each subsequent day, travels half the distance he travelled the previous day.

Two days after the prisoners escape, the Mountain is sent out to hunt them down and kill them. He travels 100 leagues each day....

Introducing the first Backdrop challenge!

Block puzzle

Why

I love puzzles! The little metal ones you have to disassemble and re-assemble, escape rooms (though I've only ever done online point-and-click ones), even Mastermind. I recently saw videos online of a guy solving 'sequential discovery' puzzles. These are intricate devices that, for example, require you to find a hidden pin, then use that pin to push a button, which releases a drawer containing a code that you can use to open the puzzle and find the treasure. Watching these videos I had the thought that I could create something like that in Backdrop CMS. And with Backdrop's 5th...

Pages