Skip to content

Instantly share code, notes, and snippets.

View olivebishop's full-sized avatar
🏠
Working from home

Olive Bishop olivebishop

🏠
Working from home
View GitHub Profile
'use client';
const GrainOverlay = () => {
return (
<>
{/* Primary Fine Grain Layer - Enhanced visibility */}
<div
className="pointer-events-none absolute inset-0 z-20 opacity-60"
style={{
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='fineGrain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='4' result='noise' seed='3'/%3E%3CfeColorMatrix in='noise' type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0.3 0.5 0.7 0.9 1.0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23fineGrain)'/%3E%3C/svg%3E")`,
@olivebishop
olivebishop / gist:528dc7229747aaa5f178601a03990bb6
Created December 11, 2024 02:15
A react compnent that show case feature like the image component in Next js (Client side)
import React, { useState, useEffect } from 'react';
// Advanced Image Optimization Component
const OptimizedImage = ({
src,
alt,
width,
height,
quality = 75,
formats = ['webp', 'avif'],
// P.S. the real moeny is at the buttom of the file
import { getTableColumns, type Table } from "drizzle-orm";
/**
* Creates a column selector for a given Drizzle ORM table.
*
* This function allows for flexible selection and omission of columns from a table.
*
* @param table - The Drizzle ORM table to create a column selector for.