Skip to content

Instantly share code, notes, and snippets.

View omimouni's full-sized avatar
👽
locked in

Oumar Mimouni omimouni

👽
locked in
View GitHub Profile
@omimouni
omimouni / daisyui-oklch-to-rgba-postcss-plugin.js
Last active April 24, 2025 16:08
This plugin specifically addresses the color compatibility issues when using DaisyUI's default OKLCH color palette
/**
* PostCSS Plugin: OKLCH to RGB Converter for DaisyUI
*
* Purpose:
* Fixes color compatibility issues when using Tailwind CSS and DaisyUI in Capacitor apps.
* Specifically targets the OKLCH color space which isn't fully supported in WebView environments.
*
* Problem:
* - DaisyUI uses OKLCH colors by default
* - Capacitor's WebView on certain platforms has inconsistent support for OKLCH
{
"basics": {
"name": "Thomas Edison",
"label": "Inventor and Businessman",
"picture": "https://example.com/photo.jpg",
"email": "[email protected]",
"phone": "(123) 456-7890",
"website": "https://thomasedison.com",
"summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.",
"location": {
@omimouni
omimouni / PdfViewer.js
Created February 22, 2025 17:42
The PdfViewer React component converts a PDF into images by rendering each page onto a canvas and displaying them as base64 PNG images.
import React, { useState } from "react";
import * as pdfjs from "pdfjs-dist/build/pdf";
import "pdfjs-dist/build/pdf.worker.min.mjs";
// PdfViewer component that renders the PDF as images
const PdfViewer = ({ pdfUrl }) => {
// State to hold the rendered images and loading status
const [images, setImages] = useState([]);
const [loading, setLoading] = useState(false);