Skip to content

Instantly share code, notes, and snippets.

@ChakshuGautam
ChakshuGautam / gist:ac1e76f55cb3ef47fea7daf4c33b0ae7
Created February 5, 2024 12:15
Docs on GitHub Pages vs Vercel (for BharatSahAIyak)
## Context
1. There is a Vercel that we already maintain.
2. There is also a doc template that is one click deployment to vercel.
3. We generally deploy markdown files only on vercel.
## GitHub Pages - Pros || Vercel Cons
1. Easier for a new devloper. They would know GH Pages before vercel.
2. No other tool.
## GitHub Page - Cons || Vercel Pros
@ChakshuGautam
ChakshuGautam / response.bingai.json
Created February 4, 2024 05:25
Bing AI Response Format
{
"type": 2,
"invocationId": "2",
"item": {
"messages": [
{
"text": "Who is the present president of india",
"author": "user",
"from": {
"id": "985157419497049",
@ChakshuGautam
ChakshuGautam / akin-spacecraft.md
Created November 7, 2023 10:05
Akin's Law of Spacecraft Design
  1. Engineering is done with numbers. Analysis without numbers is only an opinion.

  2. To design a spacecraft right takes an infinite amount of effort. This is why it's a good idea to design them to operate when some things are wrong.

  3. Design is an iterative process. The necessary number of iterations is one more than the number you have currently done. This is true at any point in time.

  4. Your best design efforts will inevitably wind up being useless in the final design. Learn to live with the disappointment.

  5. (Miller's Law) Three points determine a curve.

@ChakshuGautam
ChakshuGautam / retry.md
Created October 19, 2023 22:25
On Retry Mechanisms and Patterns
@ChakshuGautam
ChakshuGautam / postgres_recovery.md
Created October 18, 2023 02:03 — forked from supix/postgres_recovery.md
Postgres error: Missing chunk 0 for toast value in pg_toast

The problem

In some cases, it is possible that PostgreSQL tables get corrupted. This can happen in case of hardware failures (e.g. hard disk drives with write-back cache enabled, RAID controllers with faulty/worn out battery backup, etc.), as clearly reported in this wiki page. Furthermore, it can happen in case of incorrect setup, as well.

One of the symptoms of such corruptions is the following message:

ERROR: missing chunk number 0 for toast value 123456 in pg_toast_45678

This almost surely indicates that a corrupted chunk is present within a table file. But there is a good way to get rid of it.

@ChakshuGautam
ChakshuGautam / wbq.md
Last active September 12, 2023 17:10
Whiteboarding Interview Questions

Unsorted List

  1. Implement a Promise/Future.
  2. Algo 1 - BFS, DFS, Binary Search. What good are linked list and stack?
  3. Algo 2 - Maximum Sub Array
@ChakshuGautam
ChakshuGautam / stack.compass.md
Last active September 11, 2023 17:38
COMPASS Tech Stack
  1. Frontend - NextJS + Tailwind
    • Recommendation Engine (Rule Based) part of BAP - client end => npm library
    • FamilyID based integration (Digilocker...) with Tushar.
    • Wallet - Will be built from scratch (Credential Schemas can be taken from existing VC Specs) with Yash as the POC
  2. Microservices - NestJS + additonal modules for metrics (Prometheus + Grafana), telemetry, and logging. Swagger added addtionally to all modules.
    • Markerplace (Beckn) are all in NestJS (DSEP clone to begin with)
    • WPCAS
  3. CI - Use GitHub CI for tests (unit, integration, e2e), building, pushing to Dockerhub/GitHub Packages.
  4. Packages - Push docker images and to GitHub Packages.
  5. Credentialing APIs