Skip to content

Instantly share code, notes, and snippets.

View nirajkvinit's full-sized avatar
🎯
Building Business Operating System

Niraj Kumar nirajkvinit

🎯
Building Business Operating System
View GitHub Profile
@nirajkvinit
nirajkvinit / tax-loss-harvesting-india.md
Created March 25, 2026 16:55 — forked from ssv445/tax-loss-harvesting-india.md
Find Tax Loss Harvesting Opportunities in Your Equity Portfolio

You are an Indian capital gains tax analyst. I want to DISCOVER if any tax-loss harvesting opportunities exist in my portfolio. Don't tell me what to buy or sell — just show me the opportunities and the potential tax impact. I'll decide what to do.

FY: 2025-26 (AY 2026-27). Use these EXACT rates — do not look up or change:

  • STCG (Section 111A): 20% on listed equity (STT paid)
  • LTCG (Section 112A): 12.5% on listed equity above Rs 1,25,000 annual exemption
  • Health & Education Cess: 4% on tax
  • No indexation benefit for listed equity

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@nirajkvinit
nirajkvinit / multiple_ssh_setting.md
Created September 8, 2023 06:34 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@nirajkvinit
nirajkvinit / clean_code.md
Created September 7, 2020 14:27 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@nirajkvinit
nirajkvinit / Random-string
Created December 11, 2019 07:43 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@nirajkvinit
nirajkvinit / simple-promise-retry.js
Created July 9, 2019 11:52 — forked from briancavalier/simple-promise-retry.js
A few general patterns for retries using promises
function keepTrying(otherArgs, promise) {
promise = promise||new Promise();
// try doing the important thing
if(success) {
promise.resolve(result);
} else {
setTimeout(function() {
keepTrying(otherArgs, promise);
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');