Everything Frontend

Immutable Classes in JavaScript

"You can't touch this!" — MC Hammer

As the JavaScript matures and starts being used to build ever bigger projects, it might make sense to adapt some things that are generally accepted in the industry as best practices.

One of those things is the usage of immutable objects throughout the application. If you are familiar with Object.freeze, the solution might seem straightforward. As it happens with many things in JavaScript, there are some tricky things to keep in mind.

Continue Reading →

Dealing With Makefiles in IntelliJ

Lately I’ve started to use Makefiles for my frontend projects for their simplicity. In fact a combination of make + webpack + karma/mocha has been working quite well and saves me from installing three hundred gulp / grunt plugins since I can do most of the file manipulation just in bash.

Continue Reading →

App Version from Git Tag in Qt / QML

Qt + Git

While making an app it is really important to keep accurate track of the versions. Usually such a tracking is implemented via tags in version control system like git. It’s also a good idea to keep in mind semantic versioning when assigning version to your code.

But tagging your code with the right version number is only the first step. You also need to show version to the user and in some cases the system.

Continue Reading →

Different ways to evaluate string as code in JavaScript

Dynamic code evaluation is a very controversial subject in every programming language that allows it, but especially in javascript since it can be a major security risk, especially when evaluating code from untrusted source. Nevertheless it is useful technique, that can be helpful in development scenarios or in certain edge cases as an optimization tool e.g. for dynamic loop unwinding.

Let’s look look at the ways we can evaluate string as a javascript code.

Continue Reading →

Pure CSS Star Rating

This is a familiar view for most of web users:

And there are a lot jQuery plugins and plain JavaScript code that can help you create rating widget in your form. And the reason because it’s all written in JavaScript is that when a need for such a rating system first arose CSS really lacked the ability to do stuff like this.

Continue Reading →