Notes #1

I’m trying to post more regularly so I stole this weeknotes idea from Simon Willison’s Weblog. The plan is to share articles, videos, books and things I learn. Here’s the first one.


Imaginary Problems Are the Root of Bad Software

The human brain however, after billions of years of evolution, is quite talented at keeping its sanity. Much like victims of childhood hardship or abuse can find escape in fantasy books, victims of enterprise programming or freelance web development can find their escape in solving imaginary problems.

George (blog post author)

It is difficult to get a man to understand something, when his salary depends upon his not understanding it!

Upton Sinclair

OrbStack

This is Docker Desktop replacement. It’s super fast to launch and uses less system resources on my M2 Apple Silicon laptop. The vscode extension works perfectly fine and so does the docker command line tool. It’s a drop-in replacement.


rsjs: Reasonable System for JavaScript Structure

collection of guidelines on how to structure your JavaScript in a standard non-SPA web application

I find this very useful now that I’m staying away of SPAs. Most ideas are good and should be considered a starting point for designing your team’s best practices on projects that are not SPA centric.

I specially like the idea of adding bootstrap data as a JSON string on meta tags.

<meta property="app:user_data" content='{"email":"[email protected]","id":9283}'>

Building Search DSLs with Django

I’ve taken a similar approach multiple times before and it works fine with more technical users who are used to this kind of thing.

PyParsing looks amazing, I will take this for a spin as soon as possible.

Django Q objects work incredibly well with this approach.


SQLite is not a toy database

A must read if you are still questioning if you next project could use SQLite as it’s main data base.

sqlean brings the best and most useful SQLite extensions together, neatly packaged into domain modules, documented, tested, and built for Linux, Windows and macOS.


Django model constraints

Enforce model invariants at the database layer. Will help you make sure someone with DB access cannot break the invariants of the app. It might produce ugly and generic errors.


Style your RSS feed

I’ve never considered applying styles the RSS feed but the results shared on this post, is making me rethink that. I would like a super simple way doing this.


Great visualization of how an SQL query is translated to an execution plan

SQL Join Flavors

A lot of good SQL and database related links this week.


Designing Pythonic library APIs

Solid advise. ReStructuredText is not my cup of tea, it’s also what the Python standard library uses for documentation.


MkDocs
mkdocstrings
Material for MkDocs
Google Style docstrings
autoDocstring

I’ve been doing a ton of research on how to document Python libraries and these are the most useful links. TBH I find Sphinx very hard to use and as I said before I don’t like ReStructuredText.

MkDocs feels more modern and it’s Markdown centric which is nice. These links contain a bunch on information on how to create an MkDocs website and automatically generate documentation based on your module, class and function docstrings. Very nice solution.


MX Lookup
BIMI Inspector
Cloudflare DMARC Management
Prevent spam, spoofing & phishing with Gmail authentication

I do a fare share of cybersecurity consulting and recently had to do a deep dive on email validation. If you are using a custom domain make sure to set SPF, DKIM, DMARC and BIMI. Also consider using a service to manage DMARC reports, I just started using Cloudflare’s.


The Right Way to Run Shell Commands From Python

The sh library mentioned on the post looks good and I will try it next time. A do a lot of scripting in Bash but once you get to around 100 lines it starts to get impossible to debug. I have a few scripts that need a rewrite to Python and this might help out. Still, I would like to use just the standard library but a single dependency is not that bad.



TIL: Don’t forget your Web Manifest file

I need to remember to include web manifest on all of my websites. This is something I never do, because it was always very Chrome centric thing. Now with more browsers adopting I think it’s time.