Week of Mon 19th May 2025

Displaying static HTML randomly

I’m hosting the May 2025 IndieWeb blog carnival, and keeping track of submissions as they come in in a list. I’ll also be doing a roundup post where I’ll summarise the submissions in another list.

These lists could get quite long, so I’d quite like them to be displayed in a random order, so no single submission is “favoured”. Page visitors might tend to only look at the first few items in a long list, so every submission gets an equal chance to be in the top 3.

This is something that you could achieve with server side code, but is quite overkill for such a small use case. So I thought instead about how to randomise static HTML on the front end.

I don’t think there’s a way currently to do this in pure CSS, but there’s a very neat solution with just a few lines of javascript thrown in:


  • item one
  • item two

Of course, you could turn this into a more general utility function, but for now, I only need it here, so a bit of inline scripting on the page means I’m not needlessly cluttering up the sitewide js files.

It might not be immediately obvious why this code works – the append command looks at first glance that it would just add the shuffled items onto the end of the static list.

However, the reason it gives the desired shuffling behaviour is due to how DOM nodes behave when they’re moved.

The key insight is that when you call appendChild() on a node that already exists in the DOM, it doesn’t create a copy – it moves the existing node to its new position. So:

  • The first append moves that item to the end
  • The next append moves the next item to the end (after the previous one)
  • And so on…

This behavior is specified in the DOM standard – if you try to append a node that’s already in the document, it will be moved rather than duplicated. This is why you end up with a shuffled list rather than duplicated items.

An alternative way to think about it: The items array contains references to the actual DOM nodes, not copies of them. When you manipulate these nodes through the DOM API, you’re moving the original elements.

If you wanted to create actual duplicates, you’d need to explicitly clone the nodes using item.cloneNode(true).

Wild Mustard banks

The river bank changes every fortnight I come over for the raft checks for Gloucestershire Wildlife Trust. Today the banks were covered in flowering wild mustard and comfrey.

Not too much to report on the rafts again this week, although there were prints finally captured on the cartridge. Just brown rat, but at least an indicator they are still working correctly and not dried out.

I made some bread when I got back home, which I can take to the Wild Acres picnic tomorrow.

In the afternoon, I went to the library for the Dursley Code Club. I was astonished, yet again, by the complexity and depth which the children apply to using AI to produce solutions.

One boy made a browser based app to measure your walking speed using GPS. And it seemed to work! Another went to enormous lengths to specify the plan for a project with AI, before kicking off the more expensive AI agent mode. The result was a very usable and impressive 3D browser game made with just one credit.

Yet others were using AI to produce the code for pretty slick interactive web pages hosted on neocities. It’s hard to overstate quite how much ahead of the game they all are.

AI and summer picnic

Busy day planned, starting with the quarterly meeting of the Discover Dursley group at the council. My main role was to present the new Discover Dursley website which will be going live soon.

There was positive feedback on the layout, followed by a discussion on the best way to capture content from the community to build it up. I’m going to test a process on a few “friendly traders” and see how that goes over the next couple of weeks.

In the afternoon, I held my second code club of the week in Dursley library. There are no words to adequately convey just how creative the children are. Each of the last three sessions, I witnessed something draw dropping and today did not disappoint either.

A laptop screen with a Video Animation AI app on it
AI application by Julian

Julian showed me some applications made by people in his own code club that he runs at school. They were single page HTML games apps of a really high quality. He had also published them on neocities.

But then he showed me the app he’s been working on at home. There’s a poor screen shot of it above, but essentially it’s an app built with AI that also uses AI when it runs to produce an animation movie with characters. You can specify any background you like and then add characters in from a separate menu. The animation can be played and paused in the browser, and downloaded to local drive. The whole thing inside a single html page.

It’s hard to overstate just how awesome this creation is. There were many AI prompts that went into making it – and getting it to generate further AI inside the app was particularly genius. I have no idea how he did it.

This technique is exactly how humans and AI will be interacting in the future – the human acting as the creative director, and the AI doing the heavy lifting. By the time these children enter the workforce, AI will be orders of magnitude more powerful and omnipresent. If you do any kind of KVM job (keyboard, video, mouse) and are unable to harness it, you’ll be left behind.

I have no such worries about any of my code club though. They have caught the wave and will ride wherever it takes them.

Straight afterwards, I headed over to Wild Acres for an evening picnic. This is the first time everyone has got together since the project closed at the end of last year. It was really good to see everyone and catch up with what’s been happening.

Green grass in a meadow with a cut brown path through it
Grassland after goat grazing

The site was looking good – lots of sculptures had appeared and the vegetable plots were well stocked.

I took a good walk around the meadow which was looking stunning. In particular the far end where the goats were grazing last year was looking very good. All grass where there was scrub before.

There were a good array of the usual species there – greater bird’s foot trefoil, bugle, red clover and knapweed. But some of the plugs I planted last year were coming through like meadowsweet and betony.

The food was awesome as usual. Martin had baked a lasagne/cheese/pastry thing which was very delicious and everyone bought salads, snacks and side dishes to go with it. We sat around the outdoor dining table and the food and conversation flowed.

Hopefully there’ll be another one later in the summer.

Art materials at Wild Acres

Fairy flax

Evening survey

Kathy arranged an evening survey of Stinchcombe today. We met up at 7pm in the walker’s car park. Maran joined so there were three of us. The wind had whipped up somewhat so we all donned extra layers and headed over to the far side where the limestone scree slopes had been recently cleared of brash.

This area was once overtaken by trees and scrub, so it is being restored to allow the grassland back.

A survey was done last year after the initial clearing so it’s good to see the effect of the robomowers this year.

We didn’t bother marking the grid squares with flags as there were only three of us. Instead we could keep track by gps of which square we were in.

The top part was particularly species rich with plenty of horseshoe vetch and other indicator species.

A limestone scree slope with clumps of vegetation growing through it
Grass and herbs pushing through limestone scree

But as we made our way down, the story became more variable. But there were some gems like fairy flax, milk wort and valerian.

The slopes were tricky to navigate. There are literally a limestone scree which makes them the valuable habitat.

But, in all, we were able to complete 16 squares which was quite remarkable for just three of us.

Riverfly with biology students

Fantastic opportunity today to work with students from Rednock School on riverfly monitoring. We planned to use the new Lister Road site, which happens to be just behind the school. I headed over there first thing to clear some of the vegetation with loppers and then met Tony in reception to meet the students.

The format for the morning was to go and collect samples first and then analyse them during two subsequent biology lessons. Around 15 students took part, so we made our way down to the river, donned wellies and went through the safety briefing.

We had four nets, so after a demo of how to do the kick and hand samples, they split into groups to collect in different parts of the river under the bridge. We collected them into a couple of buckets that represented the upstream and downstream habitats.

After carrying them back to the school, Tony and I then set up the lab for the lesson with sample trays, pipettes, magnifying glasses, identification guides and recording sheets. We then had two back to back lessons with different groups of students who attended the collection.

We gave a short intro about the lifecycle of riverfly and the species we are looking for to indicate good river health. Then they got to work sorting out what was collected. The samples turned out to be very species rich and one group found all eight species (something I’ve never seen before). A nice lot of mayflies, but only a few cased caddisfly.

The students were excellent – smart, engaged and asking lots of great questions. They have done a lot of other monitoring as part of their studies and will use this data to produce some biodiversity indexes in future lessons.

Its great that the school have now incorporated this into the curriculum and that the local community can get involved to help inspire the students with citizen science. I look forward to helping the teachers run future sessions.

People & Money: AAH

Each week, I interview someone about their financial journey and their approach to money. By reading experiences shared by others, I hope you will be inspired to improve your own financial outcomes a little.

Today is the turn of Interactive Investor community member AAH who talks candidly about health and money.

Tell us a little bit about you …

Aged 60 and retired through ill health in 2021 (Diagnosed with Multiple Sclerosis in 2015 and had an insurance policy that paid my salary for 5 years). Before stopping work then retiring I worked within Private Banking managing a team supporting clients with their financial and banking needs.

Having worked in a bank for some 39 years in total I was able to build up a reasonable pension that I transferred to a SIPP soon after the pension freedom changes. Whilst the funds were initially managed by a financial management company I wanted to have greater control (as well as reducing costs) and moved initially to HL but more recently moved to ii.

My attitude to money may be described as blasé. It’s not, but from my early days in the Bank I viewed money as the tools I work with as a woodworkers tools are hammers and chisels, money was just a tool so it has no ‘pull’ on me. If I need / wanted something and didn’t have the money for it I’d save up until I did. Buy now, pay later etc is of no interest.

When and how did you start investing?

I always invested in my pension and max’d out my Banks Share Option Scheme and Buy as You Earn. As a result of the financial crisis you can guess my Bank shares became close to worthless. It was after this I started to invest small amounts on UK shares in an ISA. I was not massively successful or able to spend time managing my investments so looking back at it I guess I became disenfranchised with investing so to an extent it fell off the radar until the Pension Freedom changes took place in 2015 sparking greater interest for me and my health deteriorating resulting in me moving to a SIPP in 2016

You’re candid about the challenges you encountered with active investing. Did you or do you also have index funds?

Some. I consider this a cash pot recognising that it may fluctuate but it does not interest me as all its doing is tracking the S&P 500. The driver for this was keep the costs to a minimum. I invested in VHVG

Are you in the accumulation pre-retirement phase or drawdown?

I’m currently in drawdown although if you look at my pension you would consider it to continue to be in accumulation. Having retired and with my disability I spend many hours reading the financial market commentary and investigating companies for investing opportunities / portfolio management. Excluding individual company shares the rest of my monies are invested in accumulation / growth funds. Not needing the money on a weekly / monthly basis my objective was to grow my monies to pass onto our daughters. However with the budgetary changes with pensions being included in IHT calculations I’m waiting for the final rules and will need to consider what if any changes I need to consider / action.

What were your considerations when deciding to transfer from a company scheme to your own SIPP?

When I was working and being part of the Final Salary Group Pension Scheme I was aware that my life was going to be different from what we had planned due to my MS diagnosis. We had originally planned to retire possibly to France. I got a pension transfer value in early 2016 and started to review income/expenditure/potential future value with differing returns/etc and decided we would be better off taking the money and what was important was we would have a legacy to pass on. All decisions were done with numerous conversations over a bottle or 2 of wine with my wife.

Once we had decided to progress it was pretty straightforward. Working in the financial industry I knew qualified advisers and regulated companies I was able to talk things through with initially in theory and then following the prescribed process required when moving out of a defined benefit scheme.

How do you plan day-to-day spend to support your lifestyle?

Monthly expenditure is met with our income / benefits. That said given my circumstances I’m not out often so expenditure is low. Any large purchases are met with lump-sum drawdowns as required.

How would you describe your investing style?

My investment style remains growth orientated. I’ve moved away from the UK with circa 70% of my monies invested in the US. This is an approach that has grown over the last few years. I’m not so worried about a downturn in the US. I appreciate that the last 2 years have seen good growth and there is commentary about this coming to an end in 2025. I’m less concerned about this. The Trump administration appears more market orientated and talking business tax reductions will, I think, continue the forward momentum. Value is not something I would consider.

I do have a fun part of my portfolio where I’ll invest small amounts in potentially future winners in the likes of quantum computing, EV battery enhancements and self driving trucks.

Health challenges are something none of us can predict. What are some of the financial things we can do now that will help ease the burden if/when we encounter them in the future?

My health was one of the drivers for moving to a SIPP. My wife is still sore about it “why us” which I completely understand. I’m more pragmatic and described it as “Gods finger has come down and touch me on the head and there was nothing I could have done about it”. There is nothing in my past life that had I changed I would have not ended up with MS.

Having a salary payment policy in place for 5 years has made life easier and I would say to anyone they should consider something like that or some form of critical illness. You never want to need to claim on it but if you need to, it provides the support you need at what is a very stressful time. I just wish I had chosen the option to payout until I was 65 – that was my 1st investment mistake.

What sources do you use to educate and inform yourself about money? Please share links for others to follow

What are some areas that you’d like to hear other people’s experience of in the ii community?

It would be good to hear from the community on geographical split. I’ve fell into a split similar to the actual market without a planned split. Is it right to follow this or should a different approach be considered.

How often should we re-baseline a portfolio and when. It naturally feel like the start of the year would be the ‘natural’ time to do it but given for example Trump stepping into the presidency in January it maybe be better to wait say 6 months.



More interviews like this ...

The Compounder

My background is pretty standard really, brought up by great parents who worked really hard, not a great deal of money but they’d bought their council house and we had new double glazed windows, we felt we were doing alright.

I had several part time jobs whilst at school and spent plenty but saved some and soon realised how easy it is for it to slip through your hands. It was through some of this part time work and watching my Dad work 7 days a week that I started to understand that working the hours was only part of the answer and that the other part was what job you do as well as what you do with your money.

Read full interview...

DavidUK

I am 47 years old. I grew up in New Zealand and started my career as a Management Consultant. For the last 18 years I have been fortunate to work within London’s financial services sector. It’s been a tough gig but I have met some awesome people and learnt a lot about life and the world from them.

I have always had a prudent attitude to money - “Don’t spend what you don’t have and make sure you have some put away for a rainy day!”.

Read full interview...

I hope you enjoyed reading this interview. Hearing actual lived experiences of money is a powerful way to inform and inspire others on their journey.

I'd love to hear your story! If you'd like to be interviewed for People & Money, then please drop me an email on chris@uncountable.uk. It's an easy process over email that you do in your own time.

Disclaimer

I am not your financial adviser. Nor is the person interviewed above.

The information in this post relates to their financial journey. It may or may not be relevant to your own. You need to make your own decisions on your own financial strategy.

Do not buy or sell anything based solely on what you read.