How to Convert RegEx to String and String to RegEx in JavaScript
April 08, 2022Recently, I ran into a problem where I wanted to pass RegEx via api. The problem is that regular expressions are not JSON serializable. So…
👋 I'm Ashik Nesin • Sr. Frontend Engineer @Chargebee 👨‍💻• I write about modern Javascript & building web apps
Recently, I ran into a problem where I wanted to pass RegEx via api. The problem is that regular expressions are not JSON serializable. So…
Setting up Sentry in a project is straight forward. We just need to install the Sentry client and configure it. That’s it. Under the hood…
At work, we’ve started using Calendar Versioning for one of our projects. We’ve decided to use the following pattern for the version → (UTC…
When we’re writing a custom script we need to make sure that we’re we need to make sure that our code runs properly in the shell in which we…
Interceptor in axios can be attached to a request or a response. And they’re executed before or after every request and response globally…
Sometimes, we’ll need to filter date in while fetching data from Mongodb using mongoose. For example, let’s say we’ve a transaction schema…
Basically, we can get the last day of a month by passing 0 as while intializing Date Here’s a quick example of it. Any Month Current Month…
It’s 2 AM. You just found a bug in the project which needs to be fixed before you meet your client tomorrow morning. You know what causing…
Getting issue when connecting to your MongoDB using mongoose or some other ORM? Well, it turns out your password has @ or another…
useQuery in react-query package is used to fetch data from api. By default, it gets triggered when the components gets mounted. However…
VS Code is build using Electron which means pretty much everything is build using web technologies that can be customized. Most of the time…
Building forms is one of the tedious thing in developing web application. We have to think about lot of things like handling data…
When we rise a new pull request in GitHub, the chances are it would choose as a base branch by default. But most probably, we’ll have some…
Sometime we may need to access Vue router outside of the Vue instance. For instance, let’s say that you want to show standard error message…
Got stuck with sudden StoreStateProvider error while running any Gatsby command locally? Here’s how to fix it quickly: That should fix the…
Let’s say you want to update slug (URL) for one of your blog post in Gatsby. Updating it is pretty straight forward. You just need to open…
Using Regex Using array split() method Reference Last segment of URL
Axios is a light weight promised based HTTP client for both nodejs and browser. Let’s see how to handle 400 error message using it. What is…
Under the hood Gatsbyjs uses reach router for client-side routing. So we can pretty easily get the current route from any component in…
If you’re using mongoose library with serverless framework, then you might have run to the following issue Cannot overwrite model once…
Let us suppose that you’ve a customer model in mongoose and want to search multiple fields in it. Kind of like a search term that you can…
At the end of the day GraphQL is just an API end point in which we send the API request in a structured format and we the response…
Whether you’re building you’re own personal finance app or some custom app that requires your bank transaction it is usually hard to get an…
I’ve always wanted to start my own startup since my eighth grade (2007). And after years and years of just fantasying I’ve finally taken…
I was playing around with prisma and had an issue in the post-deploy Basically, I was generating schema after the Prisma is deployed using…
Lately, I’ve started getting a HTTP error when uploading some images/videos. It’s filesize/resolution is little bigger that might the cause…
Most common way of configuring AWS credentials in node are Environment Variable Load from a JSON file Updating your configuration…
Whenever we want to deploy a codebase to a server, we need to do lots of process like unit testing, linting, building, uploading it to the…
Just recently started using Visual Studio Code. They’ve cool built-in features like Git & Debugger feature is awesome ? But the thing which…
There are some scenarios when we want to prevent JavaScript from running inside of the iframe. Most common one Chrome/Safari extension’s…
Let’s say you’re building a cool e-commerce site which has wish list feature. When a user who is not logged in but adds a product to wish…
Chrome extension has different environment to perform different actions. Most common one are content script and background. Communicating…
Here’s a little snippet on how to do it.
Here’s a little snippet of how to do it using react-router & react-redux
Here’s a little snippet on how to do it.
Here’s a little snippet of how to send an email using SendGrid pretty easily
Here’s a little snippet on how to do it
Search bar is the most important component that we would need in every projects. Lets see how to build a simple search component which you…
What’s the first thing you see in e-commerce site before shopping ? Pricing ? Products ? Reviews & Recommendations ? Most of the time the…
Let say you want to automate your workflow. Like everyone you might search, ask your friends/colleague to give you some recommendation…
Uploading file is one of the most common thing in any web application. Let’s see how we can do that in less than 10 lines of code. In…
We’ll be using sendgrid to send email. Other than that all you need is SendGrid API key So in order add attachment we need to convert that…
In this article, I’ll explain about how to upload a file using axios and redux-form First, you need to download required packages using npm…
In this tutorial, we’ll see how to use custom components like react-select within redux-form. So the first thing we need to do is to create…
Setting up MongoDB is little tricky if you are using MAMP. You just need to spend little time to install few dependency and make few tweaks…
Squarespace makes it easy to build website pretty much without any technical requirement.We just need to drag and drop. And make…
Last week I was setting up SSL for our upcoming product Better HQ - Feedback and bug reporting app. When I checked our API I noticed some…
While working on our latest project we needed to remove the query string from a URL. And store it in the database. Here how I did it in…
We often have a situation where we need to test whether the given string is a valid email address or not. Here’s a quick post on how to it…
In the root directory of the website we need to create htaccess file. And the configuration for it is given below
Here’s a quick post on how to select elements with the native HTML5 Selectors. It’s based on the Michal Wachowski’s gist And here’s how to…
In this quick post, we will see how to create a simple show more button in AngularJS. In the page View And in the container
There are various scenarios where we will need to execute a callback function just after the last element like attaching events to it or…
As we all know loaders are used to indicate some process is happening. We’ll see how to add spinner in Angular. In this article, we are…
AngularJS comes with many filters build-in which help us to develop apps without reinventing wheel.Today we’ll see about how to format…
Header section will most probably come on every page in the app. We can have it as a partial file and include it in the page using ng…
You might have found yourself in the situation where you need to get a domain name from a URL string. Let’s say you’re building a Web…
CORS is a mechanism that allows resource like JS, CSS, etc. on a web page to be requested from another time. Almost every website will have…
I don’t get it, it works on my machine ! As a developer, we all experience the situation. Most of the time. Let us see how we can solve that…
Here’s little snippet on how to do it
In this post, I’m going to show you a quick and easy way to move/migrate your site from WPEngine to another host. In my case, I’m going to…
How do you search on StackOverflow? By Googling? Want to do it right from your terminal? Here’s a quick post on how to do so. Today I came…
As a web developer, you might have experienced a scenario where you have to set source of image dynamically. For say, we get source an image…
There will be times when we need to append class to body or other element when that particular page gets loaded. The other day, I…
When we install packages using composser. It just basically creates a new directory called vendor and install all the packages in it. Most…
I was playing around with my dotfiles and suddenly started getting __rvmcleansevariables every time I open Terminal. If you use Terminal all…
Whether you’re just getting started or have been building applications for years, improving your workflow helps you to stay more productive…
Unlike Ubuntu, elementary OS does not seems to have setting to change the laptop lid close behaviour. By defaults system is getting…
We know that almost every web pages in the web is dynamic which means the pages are generated in real-time. Content and Images can be…