Skip to content

Instantly share code, notes, and snippets.

View syntaxhacker's full-sized avatar
🧠
upgrading...

Rohit J syntaxhacker

🧠
upgrading...
View GitHub Profile
@syntaxhacker
syntaxhacker / opencode-custom-provider-guide.md
Created April 23, 2026 06:09
Step-by-step guide to add any OpenAI-compatible provider (e.g. NVIDIA NIM) to OpenCode with auth.json key separation

Adding a Custom Provider to OpenCode

OpenCode supports any OpenAI-compatible API via custom providers.
Your API keys are stored separately from config to prevent accidental leaks.


Architecture

| File | Purpose |

@syntaxhacker
syntaxhacker / managing-personal-and-work-git-ssh-keys.md
Created April 21, 2026 07:14
Managing Personal & Work Git SSH Keys — The Dragon Ball Z Edition

Managing Personal & Work Git SSH Keys — The Dragon Ball Z Edition

"Just like a Saiyan warrior needs to control their power levels, a developer needs to control which SSH key fires for which repo."


The Problem: One Key Ring, Two Saiyan Forms

Most of us juggle two GitHub accounts: one for work (company Org)

@syntaxhacker
syntaxhacker / useNavigationStack.js
Created April 21, 2026 06:02
Generic React Router hook for stack-based navigation. Preserves query params on back, prevents history accumulation, deterministic routing.
/**
* useNavigationStack - Generic React Router navigation stack hook
*
* Usage:
* const nav = useNavigationStack('/items'); // fallback route
*
* // Forward navigation - pushes current path to stack
* <button onClick={() => nav.goTo('/items/123')}>View Details</button>
* <button onClick={() => nav.goTo('/items/edit/123', { replace: true })}>Edit</button>
*
@syntaxhacker
syntaxhacker / react-scan.md
Created April 2, 2026 12:59
react-scan: React performance scanning tool setup guide

react-scan: React Performance Scanning Tool

Detects unnecessary re-renders and performance bottlenecks in React apps visually.

Install

bun add -D react-scan   # or: npm install -D react-scan
@syntaxhacker
syntaxhacker / branching-strategy.mmd
Last active March 27, 2026 10:47
Git Branching Strategy - GitFlow-lite for team workflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@syntaxhacker
syntaxhacker / attention-residuals-deep-dive.md
Created March 26, 2026 19:59
Attention Residuals (AttnRes) - arXiv:2603.15031 explained in layman terms with ASCII diagrams
@syntaxhacker
syntaxhacker / color.js
Last active September 19, 2022 13:09
Cooolorrrsss
// generate list of random colors except blue rgb values until green is reached
let colors = [];
const numOfColors = 10;
const unDesirableColor = (color) => {
// if color is near blue or white return true
const rgb = color.split(',').map((val) => {
@syntaxhacker
syntaxhacker / capp_treemaps.py
Created March 3, 2022 22:07 — forked from gVallverdu/capp_treemaps.py
Treemaps with python and matplotlib
#!/usr/bin/env python3
# coding: utf-8
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import squarify
import platform
# print versions
@syntaxhacker
syntaxhacker / config.py
Created November 22, 2021 18:07
send emails to gmail via python
username='' #email
password='' #password
# /usr/bin/env python
#
# Author: Red5d
#
# Description: Extract and run OCR on subtitles from a PGS-format .sup file.
#
# Example Usage: python sup2srt.py bd_subtitles.sup bd_subtitles.srt
#
# Dependencies:
# - pytesseract