LocalStorage with TTL (Time to expiry)

If you are familiar with the LocalStorage API, you know that there is no provision for setting a TTL. This post aims to show you an easy way to write up a simple wrapper to have LocalStorage with TTL. To setup TTL with LocalStorage, all we need to do is – Store items with TTL (i.e. set to expire within a given time frame) Retrieve items that haven’t expired To …read more

Moving from WebStorm/Phpstorm to VS Code

Been a user of Phpstorm/webstorm since long and wish to migrate to VS Code ? Skeptical about changing your IDE or the changes that it might bring along ? Fear not, for we will show you how you could setup VS code to be identical to Phpstorm/webstorm. Why should you migrate to VS Code ? I love using Webstorm/Phpstorm and it has been the editor of my choice since several …read more

Smooth Scroll in native Javascript/css

How to get a smooth scroll without using Jquery ? or any other library? As of 2020, such a trivial task is well supported natively by browsers. Smooth scroll can be achieved via pure javascript or even pure css. Lets check out how to smooth scroll natively using both the ways. Smooth scroll in pure Css Set the scroll-behaviour property to smooth on any class (or the whole body) to …read more

Lint on precommit Git hook made easy

This post involves setting up eslint, stylelint, husky and lint-staged to ensure you lint on precommit git hook. Less than 5 mins of setup that will automate linting and make it a part of your daily development process. If you are unfamiliar with the libraries that will be used, lets quickly see what each one of them does. Libraries Used and What they do ESlint – Tool to identify and …read more

Can I use font-weight: 1000 ?

The font-weight property is used to set the boldness (weight) of the font. The amount of boldness you get depends on the font (font-family) being used. Is it possible to surpass the standard font-weight property values and it be font-weight: 1000 ? Quick answer: Depends on your browser! According to the Css Fonts Module Level 4 specification, font-weight can have any value between 1 and 1000 (inclusive). All other values …read more

Duplicate a Mysql Database – Tutorial

Learn how to duplicate a mysql database in 2 simple steps. Many a times, you want to duplicate a database to create a backup, to test against real data or just because you want to. Lets quickly checkout how this can be done step-wise. We will be using the command line utility to duplicate the database. Duplicate a Mysql database – Assumptions Lets assume that the database you wish to …read more

How to use Webpack Analyzer Bundle

Webpack analyzer bundle helps you to visualize the output of webpack in an interactive map. It displays the size that each bundle uses before and after being minified and compressed (gzipped). This can help you to discover which bundles are huge and if any of the bundles got in by mistake. Lets check this out by installing the bundle first. 1. Installing Webpack Analyzer Bundle The easiest way to have …read more

Ubuntu/Linux – Force Kill unresponsive program in less than 10 seconds

There are several ways to kill a process in Ubuntu/Linux, discover the quickest way to force kill unresponsive program in 3 quick actions. This applies to any unresponsive application or process as well. How to force kill unresponsive program? 1. Hit Ctrl + Alt + T to open up your Terminal OR Alt + F2 to run a command 2. Type xkill. Your mouse cursor will turn into a small …read more

Fix htaccess not being read

You try to setup a project with relative urls only to discover that the browser displays an unexplainable error (“page not found” or the famous “localhost not working” error). You ensure that the rules in the htaccess are correct. Still the same thing. Suddenly, it hits you – probably the htaccess is not being read correctly or maybe not being read at all! Well you couldn’t be more right! How …read more

JWT Authentication with Symfony

Configuring JWT Authentication with Symfony can be quite tricky, especially for beginners. We’ll guide you through a step-by-step tutorial getting you up to speed. We use LexikJWTAuthenticationBundle to setup JWT Auth in less than 10 mins. Our setup for JWT Authentication with Symfony Symfony 3.x, 4.x, 5.x FosUserBundle (you may use any other user provider as well) LexikJWTAuthenticationBundle (used to setup JWT authentication) If you are very new to JWT(JSON …read more