Connect to Mongodb Atlas Using Mongoose

I’m a big fan of MongoDB. One of these days, I had to deploy a MERN stack app to a shared server. It’s hard to find NoSQL database support in these shared environments. MongoDB Atlas seems like a good option in such situations. But there’s a problem. The connect options don’t list mongoose. When you select Node, it shows the MongoDB NodeJS Driver URI. What about our beloved Mongoose? We’ll just simply choose version 2....

September 29, 2022 · 1 min

Just did my first professional TypeScript project

After 4-5 years with JavaScript (and loving it), I finally decided to give TypeScript a chance. Just coded a contract-based project with it. Both backend and frontend (react) were programmed in TypeScript. I should say that I have used typescript before on smaller one-to-three file size projects. It was mostly stuff like linear equation systems, matrix operations, basic sorting algorithms, etc. It makes you write better, quality code, and saves time....

December 26, 2021 · 1 min

How to pass socket.io to express routes in files?

Socket.io is a popular library used to enable live (real-time) communication across server and client(s). It uses events to receive to transmit data. We’ll be discussing how to use it with Express route files. We’ll be dealing with the new 3.x version of the socket.io, which is a bit different. You can have a look at this migration guide from 2.x to 3.0. Basically, we create a simple middleware: const { createServer } = require("http"); // you can use https as well const express = require("express"); const socketIo = require("socket....

February 13, 2021 · 2 min

Everything About JavaScript forEach() Loop Method

JavaScript forEach() method provides another way to loop an iterable object (like arrays). The forEach method uses callback functions to deal with each iteration. It uses callbacks, but that does not mean it is inherently asynchronous. Also, it can’t use JavaScript’s Break and Continue statements. Let’s jump right in. 1. JavaScript forEach - Basic Examples These examples will answer the question “how to use foreach in javascript?”. Expected results are shown as comments....

May 8, 2020 · 3 min

Java vs JavaScript - The Ultimate 2020 Comparison

Java and JavaScript are often confused to be the same by new learners. There are a few similarities and numerous differences between the two. I will be listing everything I can about Java vs JavaScript. Java vs JavaScript - 2020 Before starting to compare actual differences, let’s start with terminology. Why is the name JavaScript? JS was initially created as Mocha by Netscape’s Brendan Eich in 1995. It was inspired by Java and some other languages at the time....

April 1, 2020 · 5 min

How to point domains to WHM (VPS & Dedicated Server)

WHM is an awesome product by cPanel. It primarily allows you to create & manage multiple cPanel accounts, with specified parameters, in a single server. I don’t usually encounter cPanel services much because I’m primarily a Node/JavaScript developer these days. Recently, a Laravel project involved cPanels. Creating an Account & Attaching a Domain WHM allows you to create cPanel accounts with specified domain names. It’s a pretty straight forward process....

March 28, 2020 · 2 min

VideoJS vs JWPlayer - Choose the Best

The default HTML5 player is very basic and depends heavily on the browser. Hence we look for better options, we’ll be looking at two of those options VideoJS and JWPlayer. Some features that your project may require are, Customizability & Extendability (plugins) Ads functionality HLS Streaming Playlists Video quality selector Subtitle functionality Social Media videos support 360 and Virtual Reality support Image preview based on progress bar hover VideoJS vs JWPlayer For me, it’s VideoJS, mostly because it allows much more control over video flow, code, tons of plugins....

March 4, 2020 · 2 min

It's a Leap Day: Plans for next 4 years

I think 29th Feb seems an appropriate time to evaluate my finances and future goals. This will be a short personal post. Why am I writing this? What’s the purpose? Honestly, I just thought it’s Leap Day and I should write something. The purpose is to simply make myself focus on goals and stop procrastinating. How’s it going? For me, it’s relatively better than last year. I’m more experienced and fiscally stable....

February 29, 2020 · 1 min

12 Synchronous and Asynchronous JavaScript Examples

In this post, we’ll be looking at a few examples showing asynchronous and synchronous JavaScript. It’s a language of multiple flavors. Procedural & Functional Object-Oriented Asynchronous & Synchronous Structured Prototype-based Event-Driven Concurrent What is Synchronous Programming? In synchronous execution, you have to wait for the current task to finish before the next one starts. That being said, If we are talking in terms of threads, each thread can be allocated to perform a particular task....

February 18, 2020 · 5 min

MERN Stack vs Laravel - From a Developer's perspective

I’ve personally used both Laravel and MERN stack, and still have ongoing projects with both. There are many things to consider before choosing a stack to work with. For me, it boils down to the following 2 things. Do I need SEO for this project? If yes then Laravel is more favorable over MERN stack. Do I need WebSockets for some “live” functionality? then Node’s the obvious winner. Now don’t get me wrong, Laravel can do live stuff (called broadcasting) and MERN stack can be optimized for search engines, but is it recommended?...

February 15, 2020 · 6 min