Once I decided to make my site available through HTTPS protocol, I needed a SSL sertificate. There two solutions to obtain one: Make self-signed certificate Buy certificate from trusted CA Make self-signed certificate Self-signed certificate can be generated with one command: openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -... Read more 16 Nov 2023 - less than 1 minute read
In 2018 I’ve already described a logotype model creation. Now I have a need to make a SVG image logotype for site icon. Basic parameters Torus is described by two radiuses R and r, where: \[R = 10*r\] Center of the first torus: \[C_1 = (0, 0)\] Center of the second torus: \[C_2 = (-R\frac{\sqrt{3}}{2}, -R\frac{1}{2})\] Hemitoruses are ... Read more 20 Oct 2023 - 1 minute read
Let’s assume we need to get fancy shadow above our child nodes that will look like decoration over content and do not respond on any pointer events. This is easy achievable with ::before node, generated by CSS. HTML: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-w... Read more 18 Sep 2023 - less than 1 minute read
I’ve made a function to replace Map keys with specific pattern defined by another Map class. /** * Replaces keys with specific pattern. * * @param {Map} map The replace map. Contains (old key, new key) pairs. */ Map.prototype.replaceKeys = function(map) { if (map.size == 0) return; let newMap = new Map(); // At first add changed item... Read more 29 Mar 2023 - less than 1 minute read
We need compare two methods of map enumeration: via forEach method via entries enumeration Code setup will be: const N = 100000; var m = new Map(); for (var i = 0; i < 10; ++i) m.set(i,i); The first case: var x = 0; m.forEach(function(value){ x += value; }); The second case: var x = 0; for (const [key,value] of m.entries()) { x ... Read more 11 Oct 2022 - less than 1 minute read