Skip to content

Instantly share code, notes, and snippets.

View sajanv88's full-sized avatar
🏠
Working from home

Sajan sajanv88

🏠
Working from home
View GitHub Profile
// Example code
const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));
async function withRetry<T>(fn: () => Promise<T>, retries = 3, baseMs = 200): Promise<T> {
for (let attempt = 0; ; attempt++) {
try {
return await fn();
} catch (err) {
if (attempt >= retries) throw err;
@sajanv88
sajanv88 / How taskQ compares.md
Created September 7, 2026 05:15
How taskQ compares
taskQ vmihailenco/taskq oshankkumar/taskqueue-go
Payload type safety Generics: Task[T]/Handler[T]/Queue[T], compile-time checked Reflection-based task registry, string task names Concrete *Job with a JSON payload
Backends In-memory, Redis Streams, Postgres (SKIP LOCKED) Redis, SQS, IronMQ, in-memory Redis (Postgres/MySQL job-store on the roadmap, not shipped)
Crash recovery Built into every backend (XAUTOCLAIM, Postgres lease expiry) Backend-dependent (SQS/IronMQ visibility timeout) Redis Lua-script atomic dequeue plus visibility timeout
Cross-backend conformance One shared suite (taskqtest) every backend must pass Not present Not present (single backend today)
Middleware Chain() composition: logging, panic recovery, OpenTelemetry Fallback handler for failed messages Not documented
Delayed / scheduled delivery Not y
@sajanv88
sajanv88 / Node_vs_Go_bench_mark.md
Created August 24, 2026 05:28
Node_vs_Go_bench_mark
Workload (1,000,000 orders) Node (1 vCPU) Go (1 vCPU) Node (24 cores) Go (24 cores)
CPU-bound scoring, single thread 532 ms 16 ms 312 ms 9 ms
CPU-bound scoring, all cores β€” 15 ms β€” 2 ms
I/O-bound, 5 ms lookup, 10k concurrent 1.4 s 0.7 s 1.4 s 0.6 s
Memory for 1M concurrently pending tasks ~280 MB ~1,370 MB ~294 MB ~8,386 MB
@sajanv88
sajanv88 / abp-skills.md
Last active April 14, 2026 08:28
abp-skills.md

name: abp-framework description: | Comprehensive expert-level knowledge of the ABP Framework (abp.io) for building enterprise .NET applications. Covers DDD architecture, modularity, multi-tenancy, CQRS, auto API controllers, dynamic C# clients, permission/feature/setting systems, event bus, BLOB storing, background jobs, localization, auditing, data filtering, unit-of-work, EF Core/MongoDB integration, all UI frameworks (MVC/Razor Pages, Blazor, Angular), ABP Studio/Suite/CLI tooling, SaaS module, OpenIddict/OAuth, and deployment patterns. Use when building, reviewing, or architecting ABP-based .NET solutions. version: 1.0.0 category: dotnet-frameworks triggers:

  • abp
  • abp.io
  • abp framework
@sajanv88
sajanv88 / Python Fast API
Last active April 15, 2026 13:03
Place this in the root of your project. This file gives Claude the exact blueprint of your stack, commands, and strict behavioral rules to minimize token usage
# Project: FastAPI AsyncPG (Punq DI + Docker Core)
**Tech Stack:** Python 3.12+, FastAPI, SQLAlchemy 2.0 (async), asyncpg, Alembic, Pydantic V2, Pytest, `uv`, `punq`.
## πŸ€– AI Behavioral Rules (TOKEN SAVING)
- **Zero Fluff:** Output only requested code. No summaries, no conversational filler.
- **Diffs Only:** Provide only modified functions/classes, not full files.
- **No Redundant Comments:** Skip docstrings for basic routes/CRUD. Comment only complex business rules.
## πŸ— Architecture & Dependency Injection (`punq`)
- **DI Container:** All Services and Repositories are registered in a `punq` container (e.g., `app/core/di.py`).
@sajanv88
sajanv88 / Next Js Claude
Last active April 15, 2026 13:04
Claude NextJs - CLAUDE.md
# Role & Context
Expert Full-stack Engineer (Next.js 16, TS, Supabase).
Priority: Type safety, modularity, and "Server Actions-first" architecture.
# Tech Stack & Patterns
- **Framework:** Next.js 16 (App Router).
- **Architecture:** Modular Features. Store logic in `features/[feature-name]/`.
- **Data Flow:** Use Server Actions exclusively. No `/api` routes unless for webhooks.
- **UI:** Tailwind CSS, shadcn/ui (Radix), Lucide icons.
- **DB/Auth:** Supabase (Auth, Storage, PostgREST). Use `supabase-js` for server/client clients.
@sajanv88
sajanv88 / AllCultures.cs
Created March 13, 2025 15:33 — forked from hikalkan/AllCultures.cs
All culture codes and corresponding Countries.
public static Dictionary<string, string> AllCultures = new Dictionary<string, string>
{
{"af", "Afrikaans"},
{"af-ZA", "Afrikaans - South Africa"},
{"ar", "Arabic"},
{"ar-AE", "Arabic - United Arab Emirates"},
{"ar-BH", "Arabic - Bahrain"},
{"ar-DZ", "Arabic - Algeria"},
{"ar-EG", "Arabic - Egypt"},
{"ar-IQ", "Arabic - Iraq"},
@sajanv88
sajanv88 / installing-postman.md
Created December 1, 2024 11:55 — forked from pmkay/installing-postman.md
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz
@sajanv88
sajanv88 / Dockerfile
Created August 18, 2024 08:05
Nextjs multi stage docker and pnpm
FROM node:21.7.3-alpine AS deps
RUN apk add --no-cache libc6-compat
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
@sajanv88
sajanv88 / cert_bot.sh
Created May 27, 2023 05:34
Generate ssl certificates for nginx server
# BEFORE YOU RUN THE SCRIPT MAKE SURE YOU DO THE FOLLOWING:
# check if you have site folder enabled.
# cd /etc/nginx/sites-available/$DOMAIN_NAME
# If it is enabled then open it in a editor
# sudo vim /etc/nginx/sites-available/$DOMAIN_NAME
# then look for
# server_name $DOMAIN_NAME www.$DOMAIN_NAME;
# If not then add it and save it.