Redis: hset with ‘items’ parameter
In Python, Redis.hset function has ‘items’ that, per documentation “accepts a list of key/value pairs that will be added to hash “name“.”. You would think that it’s something like [(“key1”, […]
In Python, Redis.hset function has ‘items’ that, per documentation “accepts a list of key/value pairs that will be added to hash “name“.”. You would think that it’s something like [(“key1”, […]
I created a “view model” like hook in React, and asked Cursor to write unit tests for it. The hook does not have any HTML code, but it uses a […]
Typescript allows a type to reference another type defined further down in the same file, which can lead to rather interesting constructs. The vanilla circular reference fails: However, the following […]
I stumbled upon the following code in production: This sort of does the job, but any is a fruit of a poisonous tree: it should have had a much more […]
TL;DR: Lenovo recovery media is NOT like regular Windows recovery drive. It can only factory-reset your system. No command line, no recovery from image, nothing else. Hulk smash. Don’t count […]
In TypeScript (and JavaScript), both substr and substring are methods used to extract parts of a string, but they behave differently. This probably does not beat standard C++ class mt19937, […]
TypeScript allows passing class methods to functions that expect a lambda, but it won’t work at runtime. Consider this code: Suppose we have class Calculator like this: We can then […]
This is a follow up on this post. Default parameters are not the only way to do complex calculations in Python lambdas. Another idea is to use tuples and the […]
TL;DR On the client side, use trailing slash when requesting the “default” resource from a Flask app. Server: Client: Why it matters In Production If you make a request without […]
Summary WSGIApplicationGroup is a name of the Python sub-interpreter. You don’t need sub-interpreters if you run mod_wsgi in daemon mode (i.e. with dedicated processes). Always set WSGIApplicationGroup to %{GLOBAL}. If […]