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 …
Read More “Replace all occurrences in a string – Javascript”
In this short tutorial, I will show you how you can fix CORS error in socket IO in NodeJS. First, you need to use the socket IO import statement in following way: Then, with your Express app instance, you can set the following headers.
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 …
Read More “Create middleware for specific route – 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 …
Read More “Create global variable between modules – Python”
Suppose you are given a date of birth of any user and you have to get his age from it. You can do it in Javascript using the following code:
In the previous tutorial, we created a URL shortener app where user can make their URL short and easily shareable. In this tutorial, we are going to add authentication using JWT (Json Web Token) in Python. Create a Vuex store First, we need to create a Vuex store. So run the following command in your …
Read More “JWT Authentication in Python and 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 …
Read More “Create a URL shortener app in Vue JS, Python, Mongo DB”
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 …
Read More “Python API development”
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 …
Read More “Record and save audio from web – Javascript, Node JS, 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 …
Read More “Gmail SMTP New Method 2023 – PHP”