Skip to content

Instantly share code, notes, and snippets.

View adarsh-chakraborty's full-sized avatar
💻
I'm probably learning something right now. wbu?

Adarsh Chakraborty adarsh-chakraborty

💻
I'm probably learning something right now. wbu?
View GitHub Profile
@adarsh-chakraborty
adarsh-chakraborty / DB_USER.md
Created June 26, 2026 06:33
Postgres setup

Here's a comprehensive Markdown guide you can save as postgres-application-user-setup.md.

PostgreSQL Production User Setup Guide

Overview

This guide explains how to securely configure PostgreSQL for production applications.

Instead of connecting your application using the postgres superuser, you'll create:

# Increase EC2 Storage Without Downtime (Ubuntu)

## 1. Increase EBS Volume Size

AWS Console → EC2 → Volumes → Select Volume → Actions → Modify Volume

Increase storage size (Example: 80GB → 250GB)

Wait until volume state becomes:
@adarsh-chakraborty
adarsh-chakraborty / sorting_algorithms.js
Last active March 15, 2026 18:02
Some common sorting algorithms
const arr = [200, 1, 76, 13, 1231, 88, 13, 4, -2, 0, 11, 69];
function bubbleSort(arr){
let n = arr.length;
for(let i=0;i<n-1;i++){
for(let j=0;j<n-1-i;j++){
if(arr[j] > arr[j+1]){
// swap; put j into j+1
// put j+1 in j
let temp = arr[j];

Facebook Lead Generation API Setup

This guide walks you through setting up Facebook Lead Generation API integration for your application.

Prerequisites

  • Facebook App with Lead Generation permissions
  • Page Admin access to the Facebook Page
  • App ID and App Secret from your Facebook App

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@adarsh-chakraborty
adarsh-chakraborty / readme.md
Created March 1, 2024 05:20
Winrar license key

Create a file named rarreg.key in the Winrar Installation folder and the paste the following data

RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
@adarsh-chakraborty
adarsh-chakraborty / Proto in JavaScript.txt
Last active October 27, 2023 06:06
Prototype in javascript
arr.__proto__ = object
arr.prototype is same is arr.__proto__ which is a object.
and each and every object in javascript has a prototype.
that means arr.__proto__ also has a prototype
arr.__proto__.__proto__ which is actually Object.prototype which is again an object
arr.__proto__.__proto__.__proto__
@adarsh-chakraborty
adarsh-chakraborty / 1920x1080p Resolution.md
Created February 11, 2023 17:44
1920x1080p Resolution for External Monitor Fix (Ubuntu)
@adarsh-chakraborty
adarsh-chakraborty / search.js
Created January 16, 2023 16:56
Write a function that takes two strings (a and b) as arguments. Return the number of times a occurs in b.
/*
Write a function that takes two strings (a and b) as arguments. Return the number of times a occurs in b.
Test Cases:
myFunction('m', 'how many times does the character occur in this sentence?')
Expected 2
myFunction('h', 'how many times does the character occur in this sentence?')
Expected 4
@adarsh-chakraborty
adarsh-chakraborty / script.js
Created January 3, 2023 12:16
Transpose an array of strings in 2D
let strs = ["abc" , "def", "ghi"];
console.log(strs);
let strs2 = strs.map(item => {
return item.split('');
});
let transposed = transpose(strs2);