Skip to content

Instantly share code, notes, and snippets.

View chaudhuree's full-sized avatar
🍒
hungry for food

chaudhuree chaudhuree

🍒
hungry for food
View GitHub Profile
@chaudhuree
chaudhuree / README.md
Created February 26, 2024 17:32 — forked from piyushgarg-dev/README.md
Kafka Crash Course
@chaudhuree
chaudhuree / index.js
Created January 1, 2023 17:52
multer-file-upload
const express = require('express')
const app = express()
const path = require('path')
const multer = require('multer')
// For parsing application/x-www-form-urlencoded
app.use(express.urlencoded({ extended: true }));
// middlewares
app.use(express.json())
// uploaded path

MongoDB Sheet

Show All Databases

show dbs

Exit the mongosh session

exit
@chaudhuree
chaudhuree / mongodb_cheat_sheet.md
Last active November 16, 2022 17:39 — forked from bradtraversy/mongodb_cheat_sheet.md
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

git config --global user.name "chaudhuree"
git config --global user.email [email protected]
import { useState, useEffect } from "react"
export const useFetch = (url) => {
const [data, setData] = useState(null)
const [isPending, setIsPending] = useState(false)
const [error, setError] = useState(null)
useEffect(() => {
// abort controller is used to avoid the error if anyone cancle
// fetching before it is completely done
@chaudhuree
chaudhuree / server(video calling).js
Created June 13, 2022 14:46
a single user video calling app server side codes
const express = require("express")
const http = require("http")
const app = express()
const server = http.createServer(app)
const io = require("socket.io")(server, {
cors: {
origin: "http://localhost:3000",
methods: [ "GET", "POST" ]
}
})
@chaudhuree
chaudhuree / eslintrc.txt
Created June 8, 2022 14:23
eslint setting
// eslintrc.js
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
],
// 💯 flexible localStorage hook
import * as React from 'react'
function useLocalStorageState(
key,
defaultValue = '',
// the = {} fixes the error we would get from destructuring when no argument was passed