Migrating to Hugo

What eventually gave me the push to migrate to Hugo from Jekyll was not technical superiority; but difficulty of getting support online. I wanted to remove the “Subscribe via RSS” line at the footer of my Jekyll webpage. But the only information I could find about this was this discussion from 2019. Too many things have changed since then and the solution doesn’t work easily (or possibly at all). Contrast Hugo: the only difficulty I ran into was when I was deploying on Github pages (via Action), and I forgot to include the “workflows” folder within the “....

June 10, 2024

You cannot name a MongoDB collection "hello"

(A draft StackOverlow questioned that I answered for myself) Draft question I am using mongosh version 2.26 on iTerm2 (Build 3.5.0) on a Mac. I am starting to explore MongoDB with the aim of setting up a MERN website. When I run mongosh, the Mongo shell correctly opens. Within the Mongo shell, I switch to and create a new db, e.g. one called random, by > use random. $ show collections correctly shows no collection....

June 10, 2024

Doc-as-Code in theory and practice

In this Write-the-Docs London talk on 2 May 2024, speakers shared their experiences with using software tools to automate the publication of their companies’ documentation. Because these software tools are also used by programmers for computer code, this approach is also known as “Doc-as-Code”. Vladimir Izmalkov gave the first presentation. He gave a broad overview of common software tools for Doc-as-Code, including (amongst others):- Git for version control Markdown for formatting text Hugo for deploying a static website Vladimir then shared VK Private Cloud’s experience with migrating documentation from Confluence to Git in a short time frame, and in the process changing the underlying document format from Microsoft Word to AsciiDoc....

June 9, 2024

Slow Productivity: some book notes

1 American authors sometimes forget for many people the dream is to emigrate to somewhere like America. This is a very different kind of ambition from being “So Good They Can’t Ignore You”. 2 Do we have to be very “successful” in the first place? In the sense of being better by a significant than others on some objective measure? Surely not, even though that is the inevitable premise of self-help....

April 27, 2024

Convert HTML to Word

Demo: download button here for laptop and desktop Background There is an issue with Barrister Admission Bundle I have wanted to solve for some time. I wanted to make a website where users (pupil-barristers) could enter all required information at once, and then download a Word document. The Word document would have all the information in the right place. But it also needs to be modifiable (as users probably have their own style preferences)....

April 23, 2024

Dao of Web Design

I fell in love with the technology of CSS recently, having obsessively followed a YouTuber (and CSS guru) called Kevin Powell. One of the articles that Kevin recommends is the Dao of Web Design. In essence, the article argues that web as a medium is fundamentally different from printed media because the layout of a webpage has to work on so many different devices: mobile phone, tablets, laptops, Desktops And also on different browswers with customisation such as dark reader or screen readers....

April 11, 2024

Fundamentals in CSS

Kevin Powell points out that people (certainly me!) tend to be too impatient with CSS. They assume it is a “simple” technology and just resort to looking up answers on Google as they go along, without trying to understand the undelrying principles. But paradoxically in CSS more than in (say) Javascript, fundamentals matter even more. The layout of a web page differs from device to device and from browser to browser....

April 11, 2024

Promise(), not promise

Quick test: what do these code snippets do? const a = new Promise(function (a) { a }) const b = new Promise(function (b) { b("success") }) const c = new Promise(function (a, b) { b("failure") }) const d = Promise.resolve("success") const e = Promise.reject("failure") const f = new Promise(function (a, b) { a("success") b("failure") }) const g = new Promise(function (a, b) { b("failure") a("success") }) const h = new Promise(function (a, b) { throw new Error() }) const i = new Promise(function (a, b) { a() }) const j = new Promise(function (a, b) { b() }) const k = (number) => { return new Promise(function (a, b) { a(number * 2) }) } Check by opening the console in your browser and test with e....

April 3, 2024

Ask Your Developer

Ask Your Developer is Twilio co-founder Jeff Lawson’s advice to Businesses looking to survive and prosper in the digital age. In short, Jeff argues that: (1) Businesses need to embrace technology (esp. web technology) to compete; (2) Rather than buying them ready-made (e.g. from a consultancy), businesses do better by buying “software parts” and assemble a custom solution. For example, Twilio excels at providing tools for integrating mobile phone text-messaging to software programmes; Cloudfare specialises in protection from DDOS attacks....

April 1, 2024

object.property v. object[property]

I recently came across a situation where I was fetching information from a RESTful API. After some intermediate steps, I ended up with an array of objects, all of which have the same set of attribtues (e.g. including an id). I wanted to have a way of printing a list of ids of the objects, e.g. let attribute = id array.map(object => <li> object.attribute </li>) But this didn’t work. It took me a while before I realised what I needed is instead:...

March 31, 2024