Skip to content

Instantly share code, notes, and snippets.

View ramsunvtech's full-sized avatar
💭
Full Stack Developer (Java, React, React Native)

Venkat.R ramsunvtech

💭
Full Stack Developer (Java, React, React Native)
View GitHub Profile
@ramsunvtech
ramsunvtech / backend-claude-md-genrators.sh
Created June 21, 2026 11:00
Backend Claude MD Generator
#!/usr/bin/env bash
# Regenerates the "Domain modules" section of CLAUDE.md from src/modules/*.
# Everything outside the BEGIN/END markers is left untouched.
# Run from the repo root: ./update-claude-md.sh
set -euo pipefail
FILE="CLAUDE.md"
MODULES_DIR="src/modules"
BEGIN="<!-- BEGIN:modules -->"
@ramsunvtech
ramsunvtech / frontend-claude-md-genrators.sh
Created June 21, 2026 11:00
Frontend Claude MD Generator
#!/usr/bin/env bash
# Regenerates the "Routes" section of CLAUDE.md from a Next.js project.
# Works with App Router (app/) or Pages Router (pages/), auto-detected.
# Handles any route group names (parens), dynamic segments ([id], [...slug]),
# and flat structures with no groups at all.
# Everything outside the BEGIN/END markers is left untouched.
# Run from the repo root: ./update-claude-md.sh
set -euo pipefail
function convertTimeForLocale(timeString, currentTimezone, targetTimezone) {
// Check if time starts with ~
if (!timeString.startsWith('~')) {
return timeString; // Return as-is if no ~ prefix
}
// If same timezone, return as-is
if (currentTimezone === targetTimezone) {
return timeString;
}
@ramsunvtech
ramsunvtech / ReadMe.md
Created July 31, 2024 07:31
Simple Way to Deploy Node App

Clone the Latest Code from GitHub

git clone --depth=1 <REPO_URL> appName
cd appName

To remove the lock file

rm -rf package-lock.json
@ramsunvtech
ramsunvtech / timestampToActualDate.js
Last active May 21, 2024 09:19
JS Timestamp to Actual Date
function formatTimestamp(timestampInput) {
const timestamp = parseInt(timestampInput, 10);
if (isNaN(timestamp)) {
return 'Invalid timestamp';
}
// Convert timestamp from seconds to milliseconds
const date = new Date(timestamp * 1000);
const options = { day: '2-digit', month: 'short', year: 'numeric' };
@ramsunvtech
ramsunvtech / ChromeInstallationComponent.js
Created April 25, 2024 13:49
Chrome Installation React Component
import React from 'react';
const ExtensionInstaller = () => {
const handleDrop = (event) => {
event.preventDefault();
const file = event.dataTransfer.files[0];
if (file.name.endsWith('.crx') || file.name.endsWith('.zip')) {
const reader = new FileReader();
reader.onload = (event) => {
const url = event.target.result;
@ramsunvtech
ramsunvtech / image_to_string.py
Created February 25, 2024 04:38
Image to Text using pytesseract
from PIL import Image
import pytesseract
# Load the image from file
img_path = '/mnt/data/image.png'
img = Image.open(img_path)
# Use tesseract to do OCR on the image
text = pytesseract.image_to_string(img)
@ramsunvtech
ramsunvtech / BinarySearchIterative.js
Created November 5, 2021 16:45
Binary Search Iterative
function binarySearchIterative(inputArray, searchTerm) {
let left = 0;
let right = inputArray.length - 1;
while(left <= right) {
const midPoint = Math.floor((left + right) / 2);
if (inputArray[midPoint] === searchTerm) {
return true;
} else if (searchTerm < inputArray[midPoint]) {
@ramsunvtech
ramsunvtech / binarySearchRecursive.js
Created November 5, 2021 16:38
Binary Search Recursive
function searchRecursive(inputArray, searchTerm, left, right) {
if (left > right) {
return false;
}
const midPoint = Math.floor((left + right) / 2);
if (inputArray[midPoint] === searchTerm) {
return true;
} else if (searchTerm < inputArray[midPoint]) {
@ramsunvtech
ramsunvtech / nginx-micro-frontend-config.conf
Created January 10, 2021 10:49
Nginx Microfrontend Configuration
server {
ssi on;
proxy_intercept_errors on;
location /product-list {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;