Skip to content

Instantly share code, notes, and snippets.

View binlf's full-sized avatar
🗑️
NaNi?

0xbin binlf

🗑️
NaNi?
View GitHub Profile
"use client";
import React, { useEffect, useId, useState } from "react";
import { motion, AnimatePresence, MotionConfig } from "framer-motion";
import { PlusIcon, XIcon } from "lucide-react";
import { createPortal } from "react-dom";
import { cn } from "@/lib/utils";
import { buttonVariants } from "../button";
const transition = {
@faustinoaq
faustinoaq / myAngular.html
Last active March 28, 2025 22:30
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@t3dotgg
t3dotgg / try-catch.ts
Last active April 8, 2025 15:16
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};