With nextjs “getInitialProps” will run server-side when the page first loads, but then run client-side on reloads (i.e. if you navigate back to it).
This means my website breaks if you go “back” to a search results page, as it tries to hit the headless WordPress back-end – which it can’t. So it errors out, and you get this lovely message:
Application error: a client-side exception has occurred (see the browser console for more information).
Solution – put the WordPress call behind an api, and then either always hit that api from “getInitialProps”, or work out whether you’re running client side or server side, as below:
I saw a post on Mastodon this morning about the futility of making resolutions for an arbitrary 365 day period.
This didn’t sit quite right with me, so I pondered it for a while and realised what my objection is. I don’t really mind the notion that resolutions are futile (back in 2011 I moved away from the idea and language of resolutions), but I don’t agree that the time period is arbitrary.
Of course, the 1st January is semi-arbitrary – but today we return to the same relative position in the solar system that we were at 365.25 days ago, having travelled an astronomical 9×1011m in the meantime. In July 2022 we were 3×1011m away from where we are now.*
Having completed our annual pilgrimage aboard the good ship Earth, I think that it’s fair enough to stop and reflect on what has happened and changed, to celebrate making such a grand journey in time and space, and to look ahead to what might be this time around.
It made me appreciate again just how governed by “the stars” our timekeeping is. Days obviously correspond to the spinning of the earth. Months broadly correspond with the orbit of the moon. Seasons are entirely due to the orbit of the earth, as is the year. In fact the only artificial constructs are time periods less than a day (hours, minutes) – at least until you get to atomic vibrations and light wavelengths – and the grouping of days into a week, which is arguably a theological construct (and there have been interesting studies on the effects that different lengths of week have on humans).
The 1st January is only semi-arbitrary because it’s likely related to the winter solstice (and possibly the perihelion of it’s orbit), as is Christmas Day. But it also made me wonder whether Australians are more laid back than us Brits because their New Year celebration is heading into the height of summer, rather than the depth of winter? I guess in theory starting the year with days getting longer should be nicer than days getting shorter, but I do slightly shudder at the thought of the cold, dark, and wet months ahead in the UK.
Anyway, my not-resolutions are to follow. The last few years could be summarised as “make it to next year”, but it would be nice to have a slightly higher bar this time around!!
Every blessing for 2023, and I pray that God’s light would illume whatever darkness you are facing.
As I’ve already mentioned, I’ve migrated this website over to nextjs. There is a headless WordPress installation behind it still, but the pages are now pre-rendered and served statically, including pre-loading, so navigation around should be blazing fast.
The pages which aren’t pre-rendered are the archive and search pages, which are rendered server-side on demand, with infinite scroll. You’ll notice a few seconds load time for these, which is a reflection of the hardware this is running on.
There are were some bits and which didn’t quite work properly yet in this brave new world:
The formatting is iffy – in paticular the paragraph spacing, and blockquotes (done)
Easy Table doesn’t work (done)
Front page needs paging (done)
Mastodon auto-post should include an excerpt (done)
Turns out there were all pretty easy to fix, plus very straightforward to pre-render the first ‘page’ of an infinite scroll, then load the rest as one scrolls down.
Well, 2022 was even worse for us than 2021 – once again as reflected by my social media presence (or lack thereof).
However, one of the habits that has emerged for us as a family is our “Good Things” jar – where each week we take a slip of paper, and write on it all the good things from that week, and put it in the jar. This evening (on New Years’ Eve) we are going to open it and read through all the Good Things which have happened this year together.
So in that spirit, here are some Good Things from 2022:
I became a STEM ambassador, and did a careers fair at Skipton Girls’ School.
I became professionally registered, and am now a Chartered Engineer (MBCS).
Well, the radio silence since May has been for a number of reasons, a large aspect of which was some infrastructure work behind the scenes.
I manage to b0rk the pi which hosts this website, but rather than spending ages recreating all the websites, database, config, etc. I decided to put everything into Docker containers, so they can, in theory, be deployed anywhere, and should have a very rapid restore time if anything breaks. All the config files are in source control.
So each of my sites running on this host is now in its own Docker container, with an nginx running in front and doing the SSL termination and routing. Even more excitingly, this blog is now running on static HTML generated in nextjs, with a headless WordPress behind the scenes supplying some of the content.
I only switched www.eutony.net over this afternoon, and I’m not sure how long it will take new posts to appear, so it’s quite exciting really!!
Slightly unintentionally I have built up a collection of “meaningful” ties, principally from my almae matres. I didn’t really set out to do it, but now I have started doing it I am always on the look out for opportunities to get a tie which represents something.
I’ve put them on my 365, but thought it would be fun to collate to a single post.
Kicking off with my old school tie (which is horrible, and I haven’t worn since the 5th year – and I have also photoshopped out the burn mark I made in it one chemistry lesson!)
My school also had a house system (a bit like Hogwarts), and awards were giving to those who contributed to the life of the House or School (representing in sporting events, mainly). These were called “colours”, and translated into a special tie you could wear!
I was pretty rubbish at sport, but I did something or other to merit being awarded half-colours. I’m pretty sure I haven’t worn this since school, but it is just about passable.
My degree was from Imperial College, and this is the college tie.
This is possibly my favourite tie, and one I have actually worn as a tie on various occasions.
I am most proud of this tie, and I needed to prove my eligibility to buy it!
While I was at Imperial, I was the radio Station Manager for a year, and in recognition of nearly failing my degree that year I was awarded Social Colours by the Student’s Union.
I did my docorate at the University of Leeds.
Having a PhD does allow you to wear an academic hood, but at more than £100 to buy one, I thought the tie was not only a more economic option, but one I might actually wear. It’s the standard Leeds tie.
My ordination training at St Hild college culminated in a BA which was technically awarded by the University of Durham.
I also think this tie is really smart, and I have worn it in anger.
My latest addition (which only arrived this morning).
Turns out that there is a tie which commemorates being a Chartered Engineer, and this is what it looks like!
I had the excitement last week of finding out that my application for professional registration was successful – and I am now a Chartered Engineer! Technically CEng MBCS for those who are interested.
I hadn’t really clocked on to professional registration or being a member of a professional body like the BCS. Obviously I’d heard of Chartered Accountants, but never really put too much thought into it. Anyway, in my current job (at JBA Consulting) there is a emphasis on professional registration, so I thought I’d look into it. Turns out that it’s a demonstration of competence in a range of areas which I was already working in, an agreement to behave according to a code of conduct, and that you have sufficient academic (or experiential) qualifications. Because I did a Masters in Software Engineering as an undergrad I automatically ticked the qualification box, which helped a lot.
I thought I was in with a good chance of meeting the competence criteria, but you can never be completely sure with these things.
I personally have always viewed software development as closer to engineering than science, and being a member of professional body (and especally being professionally registered) means publically agreeing to adhere to a code of conduct which
covers areas which I personally have always considered to be non-negotiable for any professional, or indeed any Chrisian come to that – such as working for the public good, being ethical, continuous development, knowing your limits, etc.
The Engineering Council have a range of professional registration options to reflect people being at different stages of their careers, and I would now encourage anyone in a profession to at least look into the options – I’m sure most workplaces would support you in it.