When experimenting with Docker Swarm, I decided to set up five more nodes on my local computer. I used Alpine images in the LXC, and tried to use Docker in them. Although docker stared successfully, it was impossible to deploy any services to Alpine nodes, deployment failed with “cgroups: cannot find cgroup mount destination: unknown” error message.
Because I dislike when something that should work, does not work the way I expect it to work, I decided to dig deeper and try to fix the problem.
When I tried to use unistore instead of redux in one of my pet projects, I discovered that its TypeScript typings are not very accurate. In this post I try to come up with better typings for unistore’s connect() function.
There may be a situation where you need to mock methods or properties on window.location in Jest. However, because of peculiarities of jsdom, this could be challenging. In this post there is one of the possible solutions to this problem.
When using sass-loader 8.0.0 with preact-cli 3.0.0-next.19, preact build fails with an error: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema. options has an unknown property ‘includePaths’. Quick fix: use sass-loader 7.3.1.
Sometimes you may need to integrate debug with a high performance logger, such as pino. And of course, there is an NPM package for that: pino-debug. However, if you look at its source code, you will find out that it uses undocumented dirty hacks, which, in my opinion, make it quite fragile. This article demonstrates a much simpler solution.
I once had to work with a project which used MariaDB connector for Node.js, and for some reasons it was necessary to add Knex query builder to it. The main issue was that Knex supports only a few drivers, and MariaDB is unfortunately not one of them. I had to write a MariaDB client for Knex myself, and that was surprisingly easy.