More fun with recursive types in Typescript
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 […]
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 […]
TL;DR Under certain circumstances you won’t be able to access an HTTPS site with invalid certificate from Chrome, unless you type a magic cheat code “thisisunsave“. I was debugging a […]
I took interest in C++ random number generation because of the concept of regular_invocable. To my understanding, regular_invocable is C++’s notion of a “pure function”, or something really close to […]