Photo by xb100 on Freepik.

Even though I work as front-end developer, I studied microelectronics at university. With this background it feels to me almost primitive, how microchips are made and how they look inside. It is however very different with anyone I usually speak. Everyone uses smartphones, computers, TVs, calculators, LED lights almost every minute of their everyday life, yet almost nobody knows how their insides that consists of little pieces of plastic with metal legs are made. That is why I decided, I will share some of my vague memories of university with you.

Pray to holy Silicon!

The base of every microchip…

Few months ago I came across an interesting project. Group of skilled electrical engineers developed machine that could regenerate old lead batteries. However they needed nice interface for workers on site to operate their machine. So they asked me for help. The setup was simple — my interface will run on Raspberry Pi and it will communicate with the machine through serial interface. As a JavaScript developer my first choice was to use electron. I got some nice example for electron working with react to get started and only thing left was to have working serial communication. It seemed to…

When I started working with arrays in JavaScript I always used for cycles to do operations on arrays. I was used to it from the university where we worked with C and I had no idea there are some built-in methods that would do all the dirty stuff I had to come up with each time I decided to iterate through something. As I grew up professionally I started to use these methods and fell in love with them. They make code much easier to read, there are fewer hidden bugs and it removes a lot of repetitive code.


With Redux and Hooks

Photo by EJ Yao on Unsplash.

When I started with React, one of my first assignments was to create a modal dialog box to display some data in it. I spent a lot of time googling how to create a function that I could call to display some window. It was a natural thing to do for me. Even VanillaJs allows you to just call the alert function to display a simple dialog box. I could not understand why it is not this way in React.

But you see, that is not how React works. One of the main concepts of React is that if you…

An introduction to snapshot tests

Photo by Christina Hernández on Unsplash

I met snapshot tests at one of the legacy projects I got into. I will be honest, I did not like them and had the same opinion as a majority of other articles that just throw dirt on snapshot testing.

But then I thought: “If they are so bad, why does Jest still keep this functionality?” So, I started thinking about them and found out that they are not that bad after all.

Actually, if they are used correctly, they can come in quite handy.

What Are Snapshot Tests?

If you’ve never written any tests, snapshots are exactly what you probably think tests look…

It may seem that one person cannot change global warming and pollution in this dirty world. But if we do only small changes in our lives it can have big impact in large scale. And it is not about drastic changes like becoming a vegetarian or moving to the countryside to grow your own plants. In our everyday life there are small things that can help.

Use seasonal food from your region

Do you want to put strawberries into your smoothie in winter? Well think twice. If you live in a warm country where you can grow strawberries the whole…

No, I will not talk about some fancy video streams. I will talk about much more boring stuff. If you are NodeJs developer, you probably got in touch with stream api. When I first saw it, I was like: “Why do we need such complicated and relatively hard to maintain pattern? I can just get object, do some operations and throw it to function that consumes it!” I was partly right. In fact if you are new to streams, it takes some learning curve to understand how they work, which types do what, which one to use, how to pipe…

Avoid hackers adding a malicious SQL query into your parameter

Photo by Jefferson Santos on Unsplash

SQL injection is an attack where a hacker adds a malicious SQL query into your parameter, which is then run on the SQL server.

This can have a fatal effect on your application, as the attacker has full control over your data source. This mostly happens when you pass variables to the query with simple concatenating strings to build the final query.

To prevent this from happening, we can use prepared statements that send variables separately so they can be treated as one string and any query in it will not be executed on the database.

So far so good…

Recently, I was tasked to store some filter options into URL in a React + Redux app. It felt pretty simple as I’ve done it many times in other frameworks without any obstacles. As I was new to React, I started with research on Google how this should be done best in the most React way. I didn’t find much, only one article that used deprecated react-router-redux and for newer versions of react-router I needed to use connected-react-router. So I decided to write some guidelines on how I solved this task.

First, let’s discuss where to place URL-related functionality. I…

I decided to tell you a story about the dark ages of my professional carrier. I was still studying at university and I decided that I can earn some extra cash when I start creating simple websites or applications for local businesses. This was quite solid business plan. A lot of developers think that in this world only exists big enterprise applications. But for each enterprise application there might be thousands of small local businesses that need a simple webpage with contact information because nowadays if google won’t find you, you don’t exist. So I went to local Trade Licensing…

Pavol Kögler

Fullstack developer and JavaScript enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store