Plurrrr

Wed 26 May 2021

Octothorp

If you hover over the above title or any other article title on this blog you might notice an octothorp, also known as hash sign or pound sign, appearing after the title. This is to signal that clicking on the title leads to the permanent link for the blog page with articles. As a blog page can have multiple articles a fragment is used to jump directly to the right article.

I used the following Sass code to achieve the hash sign after the text:

article {
    > [id] > a {
        color: $heading-color;
    }

    > [id] > a:hover::after {
        content: '#';
        padding-left: 4px;
        color: $link-color;
    }
}

The first rule overrides the color of an anchor element inside an element having an id attribute that's a direct descendant of the article element. The second rule puts a hash sign after this element on hover with some additional padding and shows the hash sign using the link color.

To summarise: clicking on a heading makes the title scroll up (if there is space) and sets the address bar contents to the permalink for the clicked article including a fragment.

This all in preparation for the upcoming version 5.0.0 of tumblelog which is going to support tags per article and hence requires this type of linking with fragments.

Tree-Shaking: A Reference Guide

“Tree-shaking” is a must-have performance optimization when bundling JavaScript. In this article, we dive deeper on how exactly it works and how specs and practice intertwine to make bundles leaner and more performant. Plus, you’ll get a tree-shaking checklist to use for your projects.

Source: Tree-Shaking: A Reference Guide, an article by Átila Fassina.

Unravelling async and await

Now when I started to think about this post I was worried it was going to be rather long and arduous to research (although I believe class is going to ultimately win that crown 😜), but then I remembered I had written a blog post about how async and await worked in Python 3.5. As part of that post I went through the history of how Python got to that point of asynchronous programming, which meant I had already dived into the details of how Python evolved earlier syntax to what it has today! Thus this post is going to draw heavily from my async history post to save myself some time, so if you feel I skimmed over details then chances are it's because I covered it in my other post.

Source: Unravelling async and await, an article by Brett Cannon.