pytest-subtests
unittest subTest() support and subtests fixture
PyPI · pypi.org [1]
pytest-subtests is a package to register multiple subtests within a similar test function.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://pypi.org/project/pytest-subtests/
[2]: /thoughts/
GitHub Stars
GitHub stars posts
1859 posts
latest post 2026-05-24
Publishing rhythm
A nice codepen reference for dark forms. I am using it for my thoughts chrome extension.
Note
This post is a thought [1]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: /thoughts/
![[None]]
When setting up a new machine, vm, docker image you might be installing command line tools from places like pip. They will often put executables in your ~/.local/bin directory, but by default your shell is not looking in that directory for commands.
WARNING: The script dotenv is installed in '/home/falcon/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
To solve this you need to add that directory to your $PATH.
export PATH=$PATH:~/.local/bin
To make this change permanant add this line to your shell’s init script, which is likely something like ~/.bashrc or ~/.zshrc.
Note
This post is a thought [1]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: /thoughts/
GitHub - doyensec/wsrepl: WebSocket REPL for pentesters
WebSocket REPL for pentesters. Contribute to doyensec/wsrepl development by creating an account on GitHub.
GitHub · github.com [1]
Very inspiring textual project to check out how they set up the ui. Their intro video has a pretty epic dev experience.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://github.com/doyensec/wsrepl
[2]: /thoughts/
External Link
X (formerly Twitter) · twitter.com [1]
wsrepl is an epic websocket repl built in python on the textual framework.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://twitter.com/Doyensec/status/1681320727465672706
[2]: /thoughts/
Filter Data - WHERE - SQLModel
SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.
sqlmodel.tiangolo.com [1]
When fetching pydantic models from the database with sqlmodel, and you cannot select your item by id, you probably need to use a where clause. This is the sqlmodel way of doing it.
Here is a snippet of how I am using sqlmodel select and where to find a post by link in my thoughts database.
@post_router.get("/link/")
async def get_post_by_link(
*,
session: Session = Depends(get_session),
link: str,
) -> PostRead:
"get one post by link"
link = urllib.parse.unquote(link)
print(f'link: {link}')
post = session.exec(select(Post).where(Post.link==link)).first()
if not post:
raise HTTPException(status_code=404, detail=f"Post not found for link: {link}")
return post
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://sqlmodel.tiangolo.com/tutorial/where/#filter-rows-using-where-with-sqlmodel
[2]: /thoughts/
URL Decoding query strings or form parameters in Python | URLDecoder
URL Decode online. URLDecoder is a simple and easy to use online tool for decoding URL components. Get started by typing or pasting a URL encoded string in the input text area, the tool will automa...
urldecoder.io [1]
In order to turn url encoded links back into links that I would find in the database of my thoughts project I need to urldecode them when they hit the api. When anything hits the api it must urlencode the links in order for them to be sent correctly as data and not get parsed as part of the url.
Here is a snippet of how I am using urlib.parse.unquote to un-encode encoded urls so that I can fetch posts from the database.
@post_router.get("/link/")
async def get_post_by_link(
*,
session: Session = Depends(get_session),
link: str,
) -> PostRead:
"get one post by link"
link = urllib.parse.unquote(link)
print(f'link: {link}')
post = session.exec(select(Post).where(Post.link==link)).first()
if not post:
raise HTTPException(status_code=404, detail=f"Post not found for link: {link}")
return post
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content ...
encodeURIComponent() - JavaScript | MDN
The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will ...
MDN Web Docs · developer.mozilla.org [1]
In order to send data that includes special characters such as / in a url you need to url encode it. You have probably seen these many times in urls with things like %20 for spaces.
I’m working on a chrome extension to make quick blog posts, like thoughts or a persistent bookmark tool with comments. The backend is written in fastapi [2] and when I check to see if I have a post for a page I need to url encode it.
curl -X 'GET' \
'https://thoughts.waylonwalker.com/link/?link=https%3A%2F%2Fhtmx.org%2Fextensions%2Fclient-side-templates%2F' \
-H 'accept: application/json'
curl example generated from the fastapi swagger docs.
Here is how I used javascript’s encodeURIComponent to turn my chrome extension into a notification when I already have a post for the current page.
// Event listener for tab changes
chrome.tabs.onActivated.addListener(function (activeInfo) {
// Get the active tab information
...
🛠️ Installation | LazyVim
You can find a starter template for LazyVim here
lazyvim.org [1]
Lately in 2023 I have been leaning on lazyvim for my new setups where I am not necessarily ready to drop my full config. It’s been pretty solid, and comes with a very nice setup out of the box, the docs are pretty fantastic as well.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://www.lazyvim.org/installation
[2]: /thoughts/
-
Prime reviews an article with some hot takes about python being slow and quirky, but good enough for a lot of things. Especially data applications that have libraries written in C.
Note
This post is a thought [1]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: /thoughts/
External Link
X (formerly Twitter) · twitter.com [1]
Such an inspiring clip from Kelsey Heightower. Make good shit that inspires people rather than fake ppts of how things could be.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://twitter.com/changelog/status/1681306857951084544
[2]: /thoughts/
External Link
X (formerly Twitter) · twitter.com [1]
Next time I’m working with large headers on small screens I need to try this. I always truggle to get them to look good for most text and overflow ridiculously long words correctly or at all.
text-wrap: pretty;
text-wrap: balance
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://twitter.com/chriscoyier/status/1681407724993798144
[2]: /thoughts/
Full-text search - Datasette documentation
docs.datasette.io [1]
Enable full-text search in sqlite using sqlite-utils.
$ sqlite-utils enable-fts mydatabase.db items name description
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://docs.datasette.io/en/latest/full_text_search.html#enabling-full-text-search-for-a-sqlite-table
[2]: /thoughts/
sqlite-utils command-line tool - sqlite-utils
sqlite-utils.datasette.io [1]
I want to like jq, but I think Simon is selling me on sqlite, maybe its just me but this looks readable, hackable, editable, memorizable. Everytime I try jq, and its 5 minutes fussing with it just to get the most basic thing to work. I know enough sql out of the gate to make this work off the top of my head
curl https://thoughts.waylonwalker.com/posts/ | sqlite-utils memory - 'select title, message from stdin where stdin.tags like "%python%"' | jq
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://sqlite-utils.datasette.io/en/stable/cli.html#querying-data-directly-using-an-in-memory-database
[2]: /thoughts/
sqlite-utils command-line tool - sqlite-utils
sqlite-utils.datasette.io [1]
insert a json array directly into into sqlite with sqlite-utils.
echo '{"name": "Cleo", "age": 4}' | sqlite-utils insert dogs.db dogs -
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://sqlite-utils.datasette.io/en/stable/cli.html#inserting-json-data
[2]: /thoughts/
LZone
LZone - Cheat Sheets for Sysadmin / DevOps / System Architecture
lzone.de [1]
A nice cheat sheet for jq. jq looks so nice, but it so quickly gets overwhelming on how to select what you want. I was able to make a jq contains query.
curl https://thoughts.waylonwalker.com/posts/ | jq '.[] | select(.title | contains("python"))'
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://lzone.de/cheat-sheet/jq
[2]: /thoughts/
Looking for inspiration? sqlite-migrate [1] by simonw [2].
A simple database migration system for SQLite, based on sqlite-utils
References:
[1]: https://github.com/simonw/sqlite-migrate
[2]: https://github.com/simonw
The work on textual-paint [1] by 1j01 [2].
🎨 MS Paint in your terminal.
References:
[1]: https://github.com/1j01/textual-paint
[2]: https://github.com/1j01
Check out wsrepl [1] by doyensec [2]. It’s a well-crafted project with great potential.
WebSocket REPL for pentesters
References:
[1]: https://github.com/doyensec/wsrepl
[2]: https://github.com/doyensec
If you’re into interesting projects, don’t miss out on llm.nvim [1], created by huggingface [2].
LLM powered development for Neovim
References:
[1]: https://github.com/huggingface/llm.nvim
[2]: https://github.com/huggingface