Photo by Jon Tyson on Unsplash

In order to ensure that time in an instance is accurate, the Network Time Protocol is very crucial. But, what exactly is the Network Time Protocol?

The Network Time Protocol (NTP)

On the internet, atomic clocks are maintained to give very very very accurate UTC time. UTC time, also known as GMT, is the primary time standard. The idea of this protocol is to communicate this accurate UTC time to whoever needs it.

So, a system or an instance will communicate with a time source to get that accurate time that is originally obtained from the atomic clock available online. …


Photo by Aron Visuals on Unsplash

As a front-end developer, you may come across several use cases where you need to display the elapsed time dynamically. For example, you may need to display the elapsed time in a call interface or you may want to develop a stopwatch feature in your website. Therefore, having a reliable function that you can simply revisit and reuse would be, to simply put it, a life saver. So, I’m here to save your life.

In this post, I’m going to explain how the elapsed time can be computed and displayed using JavaScript. …


Photo by Clément H on Unsplash

This post helps form a good understanding on what Swagger Specification is and how to use it to your benefit in API design.

Topics covered in this post

  • How to Design APIs using Swagger (OpenAPI) Specification.
  • How to View a Swagger Specification File in VS Code Editor.
  • How to Insert a Swagger Specification File in Atlassian’s Confluence wiki post.

Using the Jasmine framework, I have wrote several unit tests. Those tests tested different function outputs. In certain cases, the function output was a boolean value. Looking for the proper test function from Jasmine, I stumbled upon not one, not two but three functions that seemed really appropriate.

At first glance, those three functions, which are toBe(true), toBeTrue() and toBeTruthy(), seem like they do the exact same thing, don’t they? But the question is do they really do the same thing? …


Photo by Murray Campbell on Unsplash

Comparing & formatting date & time are two crucial functionalities to any programmer. In this post, I’m sharing with you reusable user-defined JavaScript date & time functions that I have formed throughout different challenges using different resources. I gotchyou, worry not.

Hopefully this can help you save a lot of time and make date & time manipulation easier for you. You can even use these functions as a starting point to create other general-purpose or custom functions.

Before starting, you must be familiar with the look and feel of date objects in JavaScript. The basic idea you need to know…


Do you ever find yourself in need of a basic string function but just can’t find a built-in function that does the job for you? Do you always end up surfing the web, stackoverflow page after the other, until you form a solid function that does the trick for you 101 years later? Look no further as I’m here to save your life.

In this story, I’m sharing with you reusable user-defined JavaScript string functions that I have formed throughout different challenges using different resources. These functions help you save time. Lots and lots of time.

For Example, have you…


Are you trying to add the drag & drop functionality to your website, but you don’t know exactly how to do it? Well, worry not, this story explains all you need to know to get you started.

Photo by Pankaj Patel on Unsplash

To be able to drag & drop HTML elements or just drop files in your website, the following steps will be your best friend. Well, until you add the feature to your website. Then, it will be bye bye friendship.

Just note that the steps are based on the HTML drag & drop API explained in MDN web docs.


Do you want to spice up your website by adding your own custom keyboard shortcuts? If yes, then this is the post for you.

Photo by Markus Petritz on Unsplash

To add custom keyboard shortcuts, you will have to keep track of the clicked-on keyboard keys to track down when a desired combination is clicked.

The steps to achieve this are pretty simple.

1) Keep track of clicked keys

That is done by saving the clicked status for each key. This means setting the status to true when a key is clicked down and setting it to false false on the release of the key.

In order to achieve this in code…

Reema

Developer.

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