Replace all occurrences in a string – Javascript

To replace all the occurrences in a string in Javascript, we will use the following method. For example, you have the following string variable. And you want to replace all underscores with a white space. You can use the following code to replace all occurrences of underscores with a whitespace. Explanation First, you need to …

Create middleware for specific route – Python

If you are creating an API in Python, and came across a problem where you have to create a middleware but for only specific route. For example, you are creating a user authentication system and want to create a middleware that checks if the user is logged-in. But you want to use that middleware for …

Create global variable between modules – Python

In this tutorial, we will show you how you can create global variable and access them in different modules in Python. First, you need to create a file, let’s say “config.py“. And write all your global variables in it. Here, I have created a global variable my_name. In order to access it in any other …

Create a URL shortener app in Vue JS, Python, Mongo DB

In this tutorial, we will create a URL shortener app in Vue JS, Python and Mongo DB. We will use Vue JS as frontend, Python as backend and Mongo DB as database. We will be creating a single page application in Vue JS 3, FastAPI for creating APIs in Python and standard Mongo DB for …

Python API development

In this article, we will talk about basic Python API development. Python API development Install python3. Download from its official website and install. Create API by first installing following modules: Create a file named api.py and write the following code in it: Run the following command in terminal to start the API: Access it from …

Record and save audio from web – Javascript, Node JS, PHP

In this article, we are going to teach you, how you can record and save audio from web using Javascript. For saving audio files, we will teach you how you can do that with PHP and Node JS. Let’s get started First, we will create a folder named “record-audio-from-web”. Inside this folder, create a file …

Gmail SMTP New Method 2023 – PHP

In this tutorial, I am going to show you, how you can use Gmail SMTP for sending emails in PHP. Video tutorial – Gmail SMTP in PHP I will be using PHPMailer library. You can find all the code for sending email from PHPMailer documentation. Line #18: You need to set your host to smtp.gmail.com …