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 / gist:e834f1374903e5ac09a28c5ccf296eb6
Last active August 16, 2026 06:19
**FFNN (Feed Forward Neural Network)** - GeLU / ReLU / SiLU / SwiGLU
import torch
import torch.nn as nn
# --------------------------------------------------
# Simple FFN that accepts a sentence
# --------------------------------------------------
class SimpleFFN(nn.Module):
def __init__(self, activation="gelu"):
super().__init__()
@ramsunvtech
ramsunvtech / gist:17b4db17fadba0d61d97cbf8fa2fae29
Created August 10, 2026 08:23
RNN vs LSTM Memory Benchmarks
# ==============================================================================
# PROGRAM: RNN vs LSTM Memory Benchmark (100% Deterministic)
# ==============================================================================
import torch
import torch.nn as nn
import torch.optim as optim
torch.manual_seed(42)
@ramsunvtech
ramsunvtech / word2vec.py
Created August 10, 2026 00:57
word2Vec: Word to Vector with similarity
!pip install gensim
import gensim.downloader as api
from gensim.models import Word2Vec
def test_word2vec(corpus, test_words, sg=1, vector_size=100, window=5):
"""Trains a Word2Vec model and checks vocab status for test words.
Parameters:
@ramsunvtech
ramsunvtech / gist:b7a176f54c637d983723cd78d048f2c8
Created August 9, 2026 04:27
Google Colab Code to test Word2Vec model to find cosine and OOV
import gensim.downloader as api
# 1. Load pre-trained Google News Word2Vec model (~1.5 GB download)
# Note: For a faster download during testing, you can use "glove-wiki-gigaword-50"
print("Loading Word2Vec model...")
model = api.load("word2vec-google-news-300")
print("Model loaded successfully!\n")
# 2. List of test samples
test_words = [
@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;