Skip to content

Instantly share code, notes, and snippets.

View Xeven777's full-sized avatar
❤️‍🔥
FE!N 🗣️

Anish Xeven777

❤️‍🔥
FE!N 🗣️
View GitHub Profile
@Xeven777
Xeven777 / ToasterWithTheme.tsx
Created March 12, 2025 16:37
Toaster With Theme support
'use client';
import { useTheme } from 'next-themes';
import { Toaster } from '@/components/ui/sonner';
const ToasterwithTheme = () => {
const { theme } = useTheme();
return (
<Toaster
richColors
closeButton
@Xeven777
Xeven777 / prismadb.ts
Created January 30, 2025 05:54
Safe way to initialise Prisma Client
import { PrismaClient } from "@prisma/client";
const prismaClientSingleton = () => {
return new PrismaClient();
};
type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>;
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClientSingleton | undefined;
};
/* Headings */
.markdown-body h1 {
font-size: 2.5rem; /* 40px */
}
.markdown-body h2 {
font-size: 2rem; /* 32px */
}
html {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
}
* {
box-sizing: inherit;
margin: 0;
padding: 0;
}