Skip to content

Instantly share code, notes, and snippets.

@mrtcmn
mrtcmn / compress.compare.js
Created August 1, 2023 14:08
Brotli compression params compare
const zlib = require('zlib');
const fs = require('fs');
const { performance } = require('perf_hooks');
const filePath = './output.fixture.json'; // Change this to your file
const outputPath = './compressed.br';
// Weight for time and size in the calculation. Must be between 0 and 1.
const timeWeight = 0.5; // weight for time
const sizeWeight = 1 - timeWeight; // weight for size
@mrtcmn
mrtcmn / accordion.tsx
Created October 31, 2025 06:28
accordion.tsx shadcn with opening effect
"use client";
import * as AccordionPrimitive from "@radix-ui/react-accordion";
import { motion } from "motion/react";
import type * as React from "react";
import { cn } from "@/lib/utils";
const Accordion = AccordionPrimitive.Root;