Random HTML Attribute

I spent last evening and this morning playing around with Andrew’s Random MDN page. The result is a remix, Random HTML Attribute. Looking through my old commits, here are main hurdels along the way:- The MDN webpage used in the original project is no longer actively maintained: see web archive version here. I therefore needed to look for an alternative page with a similiar structure. There were a few candidates but in the end I settled on this page....

July 8, 2024

From Passport.js to Project Mood: diary of a day's reading

1 Passport.js I started the day with the excellent “Concept” section of the documenation for Passport.js, a tool for adding user authenticiation with Express.js. I have been reading into the documentation for MongDB and Mongoose recently. The trouble with them (as of 2024) was that there was a very steep jump between the very simple quick start example and the full documenation. This made getting to grips with the materials very difficult: especially because Mongoose is a kind of “wrapper” around MongoDB native driver, and when I search for how things are done, search results often use two different sets of terms....

July 7, 2024

Pupeteer

1 Well thought-out side projects Despite some misgivings that I am veering away from my cirriculum, and more generally that there is such an ocean of talent out there, I spent much of Sunday exploring Andrew Healey’s projects on his website. The main reason is that they are just so well thought-out and explained! For example, one of his side projects is this website which (1) gets your location from your IP address and (2) plays you a soothing song if (and only if) it is raining in your locality....

July 7, 2024

Schema and Model in Mongoose (1 of 2)

The point of Schema Initially I was surprised that the code below logs anything out at all. const uri = process.env.DB_URL; const port = process.env.PORT || 3000; const localTest = "mongodb://127.0.0.1:27017/test" const express = require("express") const mongoose = require("mongoose") const app = express() app.use(express.static("public")) main().catch((err) => console.log(err)) async function main() { await mongoose.connect(localTest) } // There is no "goingCrazy" property in Kitten // There is instead a "name" property of the type String....

July 1, 2024

Schema and Model in Mongoose (2 of 2)

So the point of Schema is to define what properties can be read. The point of model is instead to define what collection is read. Try const uri = process.env.DB_URL; const port = process.env.PORT || 3000; const localTest = "mongodb://127.0.0.1:27017/test" const express = require("express") const mongoose = require("mongoose") const app = express() app.use(express.static("public")) main().catch((err) => console.log(err)) async function main() { await mongoose.connect(localTest) } // There is no "goingCrazy" property in Kitten // There is instead a "name" property of the type String....

July 1, 2024

Self-cultivation for Web Full-Stack Engineers (2015): a review

Free Chinese language excerpts released by the author here. A point which really caught my eye was the author’s reaction to the Non-Designer’s Design Book by Robin Williams. In fact, this is how the author caught the eye of his interviewer for his first employer, Tencent, 我说这些作品都是我先在白纸上手绘——主要是彩色铅笔——然后用照相机拍下来,放到ps里处理一下对比度什么的,就作为一个设计了,然后还有自己喜欢的专辑里的一些元素,然后还考虑了色彩,还有一些信息的对齐之类的, 其实我的设计知识仅限于看的一本书《写给大家看的设计书》。这本书非常棒,到现在为止我都反复看了3遍以上,因为约书亚树原理说的是,当你对一个概念的名字很熟悉的时候,当你看到这个概念,就会马上意识到,而不是无意识的一晃而过。然后我就提到了书里说的设计的四大原则:对齐、对比、距离和重复,面试官表示很有兴趣。 (Rough translation: I first hand-drawed these works on white paper - mainly colored pencils - and then photographed them with a camera, put them in Photoshop to process the contrast and so on, and then used them as a design, and then included my favorite albums…...

June 17, 2024

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