Wednesday 26th May 2025

Couple things I leared today

1. Authors use git


Something which I had never considered but now seems obvious is using git for book version control.


2. Chrome caching old css


Had some issues today with css updates to this blog working in dev but not appearing in prod. After going back and forward a couple times I manually entered the url for my static/style.css and ... saw an out of date version of the file? Turns out chrome caches old versions of css and so a manual cache refresh was required.


3. The Covid summer has been surpassed


Its impossible to have a conversation about Covid in the UK without people reminicing about how nice the weather was. And turns out this isnt just rose tinted glasses: May 2020 was the sunniest May on record. That is until this past May delivered 630 hours of sunlight.


4. AI Code Powering YC Start ups


Like many engineers I feel a sort of guilt when using AI coding tools. Feels like cheating. As much as it enhances productivity I worry it stunts individual growth in hard skills. However, more and more I think this is a ludite view.
Today I heard that roughly 25% of YCs Winter 2025 batch have code bases primarily (>95%) made up of AI generated code. 3 years ago this number would have been roughly 0%, what will it be 3 years from now? Is learning hard skills around software development still worth it or should we focus on learning how to use AI tools.


5. Scary turnips


Pumpkin carving originates from turnip carving. Back in the day the celts had traditions of carving turnips during the Samhain festival which was a precursor to halloween (scheduled at the end of automn, spirit world is closer to ghosts, all that usual jazz). This tradition continued all the way until Scots and Irish (descendent from the Celts) migrated to the new world and opon encountering pumkins realised they made a better canvas. Don't taste quite as good though.


Monday 25th May 2025

Here are 5 things I learned on a lazy Monday recovering from a race yesterday.

1. HTML does not fully match markdowns vibe


When writing this blog post today I was using a basic solution of saving the blog post in a markdown file so that I could control the formatting pretty easily. However, after rendering the markdown in html suddenly my backslash linebreaks were just rendering as backslashes.
So how does HTML render markdown? Well firstly, its not really correct to say HTML renders markdown. Whats actually happening is the markdown is being converted into HTML, this is then injected into the rest of the HTML and then rendered all together.
So how is markdown turned into html? This is done by the markdown parser. A markdown parser is a tool for converting markdown into HTML. In the case of this web app we are using the python package 'Markdown'. This package takes your markdown and does the following 6 stages:

Stage 1 Preprocessing: cleans and normalizes the raw markdown.

Stage 2 Block Parsing: Identify block level elements (blocks are just lines that start new sections ie headers, lists, blockquotes etc)

Stage 3 Inline Parsing: after each block has been parses, the next stage is to process inline markdown within each block ie bold text, italic text, links, etc

Stage 4 Build the element tree: so we have block elements and inline elements. Each of these elements becomes a node and they are structured into an ElementTree (sort of like a DOM). This allows for specifying the hierarchy ie block A contains inline element B.

Stage 5 Treeprocessors and Postprocessors: treeprocessors essentially take the element tree from stage 4 and enhance the structure. They work before the HTML string has actually been created. They make structural changes like wrapping sections in div tags, injecting new eleements, reordering elements, etc. Postprocessors then work after the HTML string has been created. They manipulate the raw output as plain text such as formatting whitespace, injecting script tags, etc.

Stage 6 Render HTML output: The final element tree is then converted to a flat HTML string and injected into the page. When the new html file is then passed to the browser, the browser does not see any markdown it just recieves the HTML.

Okay lovely tangent but how does this relate to our backslash linedrops becoming ...well becoming just backslashes?

Answer: because the backslash is not a line break character in markdown, it is an escape character which is not transformed into html by this markdown parser and so gets injected into the final html string as just '\'. As a single backslash has no special meaning in HTML this just renders as a backslash character.


2. Spurs Score Goals


This season saw spurs accomplish the remarkable double of finishing 17th in the league and yet simultaniously ending their trophy drought with a Europa League win. Yet seeing the name of a European champion so low in the table isn't the only thing that stands out. Looking at the final prem table spurs managed a tally of 64 goals! 64 goals and finishing one spot above relegation! Has this ever happened before? I felt like like checking.

So I asked a very simple question: who were the lowest ranked premier league team to score at least 64 goals? To make it fair I only looked at EPL seasons from 95-96 onwards since prior to this each season had more games. 30 seasons worth of football.

Answer: Prior to this season the lowest ranked team to score at least 64 was the team finishing 8th in the 2022-23 season. This team was also Spurs.

In fact, since the start of the 95 season the lowest team to score at least 64 goals have averaged 5th place in the league and on 4 occasions the lowest team to hit the back of the net 64 times have managed to come 2nd in the league!


3. I cant believe its not sweetcorn


Sweetcorn, as the name sort of suggests, is just a type of corn. However, the vast majority of corn grown is not sweetcorn. Its fieldcorn. Sweetcorn only accounts for ~1% of corn grown whereas field corn makes up ~99% of corn grown around the world.

Field corn is used for animal feed, industrial products, and processed foods like cornmeal and cornstarch.


4. Hello, Chrome Extension


How do you actually make chrome extensions? Some form of javascript shenanigans most likely but I wanted to build a super basic one just to get a feel for it.
So essentially you just need 3 things (well 2 things if you had 0 javascript but thats less an extension and more just a manual popup) Thing 1: manifest.json file, this basically just gives chrome the meta data of your extension (name, version, files used) and very importantly also where you connect to storage
Thing 2: html file. Self explanatory really, contains html.
Thing 3: javascript file. Where the magic happens

The just save all of the above in a directory, go to chrome extensions, switch on developer mode, and 'Load unpacked'. Congrats you now have an extension. Very handily the the chrome monitors for changes in the local copy of the directory so you can test changes in real time rather than constantly re-uploading your extension. Pretty cool.


5. Dry


After an unusually long dry period its finally raining in Edinburgh again (just in time for the EMF of course). Seeing it rain made me realise I dont actually remember the last time I saw rain. Very strange occurance living in Scotland. So had a look at the SEPA website to check how dry it actually was.

Turns out between the 26th April 2025 and 22nd May 2025 the weather station at the Royal Botanic Garden recorded 0mms of rain. 26 days without rain. Wild.