TMvK

Thoughts, stories and ideas. Mostly IT.

  • Home
input

Quickie: JS - input change

Many developers try to handle change of input value with change or keyup/keydown event listeners. Well, that's not enough. You can change the value also by: dropping selected text, copying it to

TvK
semantics

HTML

I'd like to make a small series of correct markup / semantic HTML. I have many drafts of smaller parts and will publish them later. So here is a small introduction to them. I

TvK
rsync

Quickie: Rsync

Just a command to help you backup / archive your server. sudo rsync -avhe 'ssh -i /home/user/.ssh/id_rsa -p 2222' \ --numeric-ids \ --progress \ admin@your.server.tld:/path/to/your/data/ \ /path/

TvK
toFixed

Quickie: JavaScript decimal multiplication

Another oddity of JavaScript I found. Multiplying decimal numbers can be tricky (or malicious?). Order of numbers can matter in multiplication. // order #1 135*1.15*10.5 // = 1630.125 // order #2 1.

TvK
quickie

Quickie: shortened "for" and "if"

If Today after debugging minified JS code I discovered an interesting way to write ifs: var i = 0; var s = 'foo'; if (s === 'bar') { i = 1; } can also be written: var i = 0;

TvK
swarm

Leaving Swarm

My little story of why I switched to Docker Swarm. And few weeks later left it for "standard Docker". First I had one server, which ran Docker. I used nginx-proxy image

TvK
php

PHP - static vs self

PHP's difference between static and self. class Mom { private const DEFAULT_AGE = 21; public static function getName(): string { return 'Alice'; } public function tellAge(int $age = self::DEFAULT_AGE): string { return 'My age is:

TvK
php

Quickie: a = b || c

This little post can be handy specially for full-stack devs, who use JS and PHP. PHP being a requirement here. Do you know what happens when you assign OR-logical expression to a variable?

TvK
meter

Correct markup - <meter> vs <progress>

What's the difference between <meter> and <progress> and when to use them? Meter indicates value in given range. Do not use this for progress indication. You can set min,

TvK
docker

Quickie: Docker - root

Have you ever gave up solving some server problem and gave temporal non-root access to anybody? Or shared your hosting with some other person, how is not supposed to run sudo? If you

TvK
javascript

Quickie: round()

Once again, different programming languages give different results. Now let's focus on rounding negative numbers. Python + PHP print(round(-1.5)) # -2 print(round(1.5)) # 2 echo round(-1.5) // -2 echo

TvK

2017 recap

Duolingo In January I signed up to Duolingo. Since about August I started a long streak. The last day of year I reached 142 day streak! I got to learn a lot of

TvK
bash

How long are you working?

When you want to get notified every half hour how long you are already working, you can use this simple script, run it in terminal. Notice however, that it won't save your life

TvK
languages

Ni - vi

While I was learning Swedish and Esperanto courses on Duolingo, I noticed how they have opposite meanings for words ni and vi. So I had to look etymology of them on Wiktionary. Swedish

TvK

A blog was born

On this blog you'll find for the most part IT stuff, some language oriented topics and who knows what more. Although English isn't my native language, most of my posts will probably be

TvK
TMvK © 2025
Latest Posts Ghost