Shtille's blog A development blog

SSL certificate setup

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

Logotype SVG creation

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

Fancy overlay over content

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

Replace map keys function

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

Map enumeration performance comparison

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