Skip to content

Instantly share code, notes, and snippets.

View sankalpmukim's full-sized avatar
👋
Always learning!

Sankalp Mukim sankalpmukim

👋
Always learning!
View GitHub Profile
### 0 — Purpose
These rules ensure maintainability, safety, and developer velocity.
**MUST** rules are enforced by CI/review; **SHOULD** rules are strong recommendations; **CAN** rules are allowed without extra approval.
---
### 1 — Before Coding
- **BP-1 (MUST)** Ask clarifying questions for ambiguous requirements.
- **BP-2 (MUST)** Draft and confirm an approach (API shape, data flow, failure modes) before writing code.
- **BP-3 (SHOULD)** When >2 approaches exist, list pros/cons and rationale.
@alexanderson1993
alexanderson1993 / AlertDialogProvider.tsx
Created April 2, 2023 19:07
A multi-purpose alert/confirm/prompt replacement built with shadcn/ui AlertDialog components.
"use client";
import * as React from "react";
import { Input } from "@/components/ui/Input";
import { Button } from "@/components/ui/Button";
import {
AlertDialog,
AlertDialogContent,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogDescription,
@junderw
junderw / aesWebCrypto.js
Created March 26, 2019 02:10
Using web crypto API for AES-GCM encryption and decryption.
async function aesEncrypt(data, password, difficulty = 10) {
const hashKey = await grindKey(password, difficulty)
const iv = await getIv(password, data)
const key = await window.crypto.subtle.importKey(
'raw',
hashKey, {
name: 'AES-GCM',
},
false,