Plurrrr

Mon 07 Feb 2022

Font-independent pixel-perfect negative CSS text-indents

The CSS text-indent property is used to offset the first line of text in a text block from the parent element’s inner box (the content area). It behaves like the padding-inline-start property, but only for a paragraph’s first line of text. It’s meant to allow your design to e.g. indent the first line to designate the start of a new paragraph (a more compact alternative to separating paragraphs by empty lines).

The text-indent property has some additional uses with negative values. In this article, I’ll explore how the property can be used to implement hanging punctuation and list item markers. I’ll also discuss how difficult it is to know how many pixels to subtract for the desired effect, and how you should implement it instead. Some familiarity with CSS syntax, layout concepts, and common properties is assumed.

Source: Font-independent pixel-perfect negative CSS text-indents, an article by Daniel Aleksandersen.

Select the most recent record (of many items) with PostgreSQL

Time-series data is ubiquitous in almost every application today. One of the most frequent queries applications make on time-series data is to find the most recent value for a given device or item.

In this blog post, we'll explore five methods for accessing the most recent value in PostgreSQL. Each option has its advantages and disadvantages, which we'll discuss as we go.

Source: Select the most recent record (of many items) with PostgreSQL, an article by Ryan Booz.

Using 'git rebase' to Perfect Commits

I have long tried to get into the good habit of committing as I develop. However, I often fell into the same scenario. On commit №4, I would realise that I should have worked something differently in commit №2.

Naively, my old approach was a combination of adding extra re-work commits and different forms of git reset. git rebase to the rescue!

The git rebase -i command was everything I believed had to be part of git but didn’t know of. The -i flag is the ‘interactive’ mode of git rebase. Which allows you to choose which commits you want to rebase.

Source: Using 'git rebase' to Perfect Commits, an article by Adam Hawley.