JavaScript – Recursive function example

What is a recursive function A recursive function is a function that calls itself. It keeps doing so until it reaches a specific stopping condition (known as the base case). This approach makes it possible to solve problems that involve repeating the same operation on smaller pieces of data, such as summing elements in a […]

Read more

strict_types in PHP – How It Works and Why It Matters

strict_types in PHP By default, PHP uses what is known as “type juggling”, which means automatic type coercion. In practice, this means the PHP interpreter tries to “guess” what type you intend to use and converts values on the fly, without throwing errors or even warnings. For example, if a function or operator expects a […]

Read more

Git – How to restore deleted branch?

Most developers have accidentally deleted the wrong branch at least once. Fatigue, distraction, or just a bad moment – it happens. Once you realize what just occurred, the first thought is usually: “Oh no, what have I done?” (well, the real first thought contains considerably more swear words, but I’ll skip those). In a moment […]

Read more

Git – Ignoring Files Locally

If you use a version control system like Git, you’ve probably encountered situations where certain files exist in your project but should not be committed to the repository, for example, files containing credentials, local environment configuration, or temporary logs. Excluding files from the repository is handled by the .gitignore file. It works like a filter […]

Read more

What Is JSX (JavaScript XML)?

What Is JSX (JavaScript XML)? JSX is a syntax extension for JavaScript that allows you to write HTML-like structures directly inside JavaScript code. It was created by the Facebook team (now Meta) in 2013 as part of the React library and has since become a standard in the frontend ecosystem. Instead of separating logic and […]

Read more

Multiple SSH keys configuration for GitHub and GitLab accounts

If you have multiple GitLab or GitHub accounts (for example, a personal account and a company account) and each of them uses a different SSH key (which is a good practice), you can define a separate authentication configuration for each account. This allows your development environment to automatically determine which SSH key should be used […]

Read more

Login to server using SSH key

To log in to a server using an SSH key, you first need an SSH key pair. You can learn how to generate SSH keys in the following article: You can log in using the ssh command by providing the username and the host name in the following format: ssh [email protected] SSH login with private […]

Read more

Generate SSH keys in Windows

What is ssh key? SSH (Secure Shell) uses asymmetric cryptography, a mechanism based on two related keys: a public key and a private key.Each of them has a specific role: When connecting to a server using SSH: Thanks to this process, SSH authentication is significantly more secure than traditional password-based login: In practice, this means […]

Read more

Generate SSH keys on Linux or Mac

What is SSH? SSH (Secure Shell) is a network protocol that allows you to securely connect to a remote server and execute commands on it. Authentication can be done in several ways: using a username and password, SSH keys, or an additional token (for example, when using two-factor authentication). SSH Keys SSH keys are one […]

Read more

Event delegation and event propagation in JavaScript

1. Event propagation Event propagation is the way events travel through the DOM tree. There are two directions of propagation: Example of event propagation Let’s assume we have the following HTML: And we add two event listeners: If you click on #child, you will see in the console: This happens because the event bubbles (it […]

Read more