Skip to content

Instantly share code, notes, and snippets.

View bkanhu's full-sized avatar

B Kanhu Charan bkanhu

View GitHub Profile
@bkanhu
bkanhu / README.md
Last active October 24, 2024 06:57
NodeJS Backend production issues and fixes.

Production Bugs and Fixes

1. Avoid Using Nodemon in Production

Do not use Nodemon in the production environment as it is intended for development purposes only.

2. Configure PM2 with Ignore Paths

When running the backend using the Process Manager (PM2), ensure that all folder names are included as values of the ignore_path property in the ecosystem.config.js file.

@bkanhu
bkanhu / Cloudinary-MongoDB-upload.md
Created July 4, 2023 17:31
Upload product data to MongoDB and images to Cloudinary in a MERN stack application.

To upload product data to MongoDB and images to Cloudinary in a MERN stack application, you can follow these steps:

  1. Set up your MongoDB and Cloudinary accounts: Ensure that you have created accounts and obtained the necessary credentials for both MongoDB and Cloudinary.

  2. Set up the server-side (Node.js) code:

  • Create an Express server to handle API requests.
  • Install the necessary dependencies: express, mongoose, multer, cloudinary.
  • Create a schema for your product in a Product.js file, using Mongoose:
const mongoose = require('mongoose');
@bkanhu
bkanhu / REGEX.md
Last active February 20, 2023 18:51
REGEX

INDIAN PIN CODE:

/^[1-9][0-9]{5}$/

Here's what this regex means:

  • ^: This anchor matches the start of the string.
  • [1-9]: This character set matches any digit from 1 to 9 (the first digit of the PIN code cannot be 0).
  • [0-9]{5}: This character set matches any five digits from 0 to 9 (the remaining digits of the PIN code).
  • $: This anchor matches the end of the string. Put together, this regular expression matches any six-digit string that starts with a digit from 1 to 9 and ends with five digits from 0 to 9, which is the format of a valid Indian PIN code.
@bkanhu
bkanhu / etst.json
Last active February 1, 2023 12:06
dfghjasdsd
@bkanhu
bkanhu / projects.json
Created December 1, 2022 07:58
sample project data for portfolio
{
"project_build": [
{
"title":"MaaBastralaya",
"text": "A online Cloth Store. Build on WooCommerce.",
"href": "https://maabastralaya.com/",
"stack":[
"WordPress",
"WooCommerce",
"RazorPay"
@bkanhu
bkanhu / JavaScript.md
Last active December 31, 2021 10:07
JavaScript Zero to Hero

JavaScript Zero to Hero

If I were to restart Javascript again from scratch then I will follow this roadmap.

JavaScript basic steps:

  • What is JavaScript?
  • Declaring JavaScript Variables: var, let, and const
  • Basic math in JavaScript — Numbers and operators
  • JavaScript syntax
  • ES6 let VS const variables Var, Let, and Const - freeCodeCamp
[
{
"name": "John Doe",
"designation": "Developer",
"Contact": [
{
"type": "primary",
"number": "9087654321"
},
{
@bkanhu
bkanhu / Discrete_Mathematics.md
Created May 25, 2021 19:22
Discrete Mathematics Syllabus for MCA

Discrete Mathematics

Modules

  • Number Systems
  • Propositions and Logical Operations
  • Counting
  • Relations
  • Graph theory
  • Group theory
  • Lattice theory
@bkanhu
bkanhu / settings.json
Created May 25, 2021 19:16
My VS Code Settings 2021
{
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"liveServer.settings.donotShowInfoMsg": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
@bkanhu
bkanhu / windows-terminal-settings.json
Last active December 10, 2020 07:25
Windows Terminal custom settings with width height adjustment, set CMD as default instead of PowerShell and add Git Bash
// This file was initially generated by Windows Terminal 1.4.3243.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",