Notes #10

semgrep

Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.


Cómo imprimir libritos artesanales A7


Text Fragments API


Rule of least power

Computer Science in the 1960s to 80s spent a lot of effort making languages that were as powerful as possible. Nowadays we have to appreciate the reasons for picking not the most powerful solution but the least powerful. The reason for this is that the less powerful the language, the more you can do with the data stored in that language. If you write it in a simple declarative form, anyone can write a program to analyze it in many ways.


Multi-page web apps

For most use cases, a website (or multi-page app if you prefer) is going to provide the most robust experience for the most number of users. That’s because a user’s web browser takes care of most of the heavy lifting.

there are times when a single-page approach makes sense—it all comes down to whether state needs to be constantly preserved. But these use cases are the exceptions, not the rule.


Linear code is more readable

…do not extract small functions from linear code, especially if you only use them once. None of the benefits offsets the loss in linearity.


Chatham House Rule

Under the Chatham House Rule, anyone who comes to a meeting is free to use information from the discussion, but is not allowed to reveal who made any particular comment. It is designed to increase openness of discussion. The rule is a system for holding debates and discussion panels on controversial topics, named after the London headquarters of the Royal Institute of International Affairs, where the rule originated in June 1927.


Learned how to open a browser to a specified URL from a Go program

var err error

swith runtime.GOOS {
case "linux":
    err = exec.Command("xdg-open", url).Start()
case "windows":
    err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
    err = exec.Command("open", url).Start()
default:
    fmt.Println("Open web browser to example.com")
}

if err != nil {
    log.Fata(err)
}

templ

This is the coolest templating language I’ve seen in a while. Very exited to used this on my next Go web project.

Create components that render fragments of HTML and compose them to create screens, pages, documents, or apps.


stamina

Transient failures are common in distributed systems. To make your systems resilient, you need to retry failed operations. But bad retries can make things much worse.


Parsel

Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors


Hypothesis

Hypothesis is a Python library for creating unit tests which are simpler to write and more powerful when run, finding edge cases in your code you wouldn’t have thought to look for. It is stable, powerful and easy to add to any existing test suite.


socket

Build desktop & mobile apps for any OS using your favorite frontend libraries. Includes local-first and P2P as first class features.


CSS Findings From The Threads App


3 IRL use cases for Python and HTMX

There is nothing HTMX does that you couldn’t do in another way. But HTMX pairs wonderfully with traditional server side frameworks and gives you clean, correct, results quite fast.


What Are Accessibility Overlays?