Celebrating a fundamental web technology that kicked off many careers and was retired at the end of 2020

Image for post
Image for post
Adobe Flash Player Uninstaller

Google Chrome removed the Adobe Flash plugin completely at the end of 2020. This marks the end of an era. The era dominated by one proprietary software that for many years defined how the internet looked. Many promised, only Flash delivered.

What Is Flash?

Or better question: What was Flash, and how did it shape and dominate computer entertainment and the early internet industry while being a proprietary product?

Let’s move back in time to the turn of the century. It’s the end of the 90s; Microsoft released MS Windows 98, and the browser war is on the rise. There is no Chrome…


Image for post
Image for post

All software engineers should be familiar with design patterns. One of the most known and common one is the singleton pattern. If you want to understand this pattern and how to use it with Node.JS read this quick and easy tutorial.

A bit of theory

We need singleton when we want to make sure there is only one object instantiated. Therefore, instead of creating a new object we need to ensure the constructor was called only once and then we reuse the instance.

We can achieve this by refactoring our class to have:

  • hidden (private)constructor
  • public getInstance method that returns instance of the class


A solution to the popular interview question

Image for post
Image for post

In this article we are going to check a few techniques how to make the first letter of a string Uppercase. This may be a popular interview question so let’s deep dive into many ways of achieving the same result.

First, let’s look at a few test strings together with expected results:

'here is a string'   ==> 'Here is a string'
'the New York Times' ==> 'The New York Times'
'...continued' ==> '...continued'

Simple yet working

One way to uppercase the first letter is basically to… uppercase the first letter of a string:

const s = 'here is a string'; const result =…


Here’s why rounding numbers in JavaScript is still a problem

Image for post
Image for post
Photo by Nick Hillier on Unsplash.

It is 2020 (or maybe2020.0000000000000004) and rounding numbers is still a problem in JavaScript. Actually, it’s a problem in computing in general.

Here is a definitive guide on how to do this properly using JavaScript. Read through once and remember forever!

Introduction

First of all, let’s understand why floating numbers have been, are, and will continue to be a problem in computing.

Each number is a sequence of bytes. For example, the decimal number 3 is binary 00000011. That’s basically how computers represent each number — with bytes (i.e. one byte is 8 bits: 0or1). If we take eight bytes, 00000000


How refactoring of obtuse value can make our code cleaner and easier to understand.

Image for post
Image for post

What’s actually a magic number? Basically, magic number is a code, cipher or number that has some “magic”, obscure but important meaning. However, just from reading the source code it’s not clear what’s the meaning.

It’s like finding the Answer to the Ultimate Question of Life, the Universe, and Everything. The answer is: 42. Why 42? ¯\_(ツ)_/¯

Let’s go back to computer programming and imagine we get some code back:

const response = await API.request();if (response.code === 5) {
// DO SOMETHING
}

Here we can see a magic number. 5 means something but looking at the source code…


Explained and done right!

Image for post
Image for post

Quick introduction

Latin alphabet is widely used across the World. Its base for many European languages, including English. In fact, English alphabet basically it’s the same as ISO basic Latin alphabet and consists of 26 letters: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z.

However, all other non-English, Latin based alphabets will have some special letters. …


Image for post
Image for post

When working with strings in JavaScript we may encounter a task to substitute all occurrences of a string with another one.

Let’s create a very simple test case that will illustrate the problem. First, let’s define a testString and our goal will be to replace all foo strings with bar:

const testString = 'abc foo def foo xyz foo';

The simple and naive way would be to try something like replace() function:

const result = testString.replace('foo', 'bar')

Once we run this we get only the first occurrences replaced and the result will be:

abc bar def foo xyz foo

Definitely…


Image for post
Image for post

While Number and parseInt may look similarly there are a few major differences that may lead to confusion and bugs. In this article we will go through the differences and explain them one by one.

First of all, let’s note that parseInt is used to parse string values into integers with given radix. The second parameter is optional. However, it’s a bad practice not to use it as this leads to errors. For example, if we pass 255as hexadecimal value (FF) which is prefixed with 0x it will be correctly autodetected and parsed. Yet, octal number which are prefixed with…


Image for post
Image for post

In this tutorial we are going to enable binary support in API Gateway using AWS console. This task may not sound too complicated yet looking at number of related questions on Stack Overflow [1] [2] [3] and comments like:

I’ve been struggling to do the same for days, but couldn’t find any documentation to back up that it’s possible

it’s not that easy and the process is confusing.

Moreover, in this tutorial we are not going to use CONVERT_TO_BINARY. It’s not necessary. We are going to use as little changes as possible to get binary media types to work.

First…


Image for post
Image for post

Joining two arrays may sound like an easy task yet looking, for example, at this StackOverflow question and the number of answers (let’s note that none was accepted up to this day!) it may cause a bit of headache.

While we can use external libraries to join arrays, we can simply rely on plain JavaScript. In this article we are going to look how to do it with plain JS and also with the newer ES6 syntax.

First of all let’s define the problem.

We have two arrays abc and def. We want to join them together into one, single array with all the elements present:

const…

Arek Jaworski

Programming, project management and politics

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