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
@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,