Skip to content

Instantly share code, notes, and snippets.

@lambdaxyzt
lambdaxyzt / image.jsx
Last active April 8, 2025 21:37
Remix Image Component ( use cache 'cacashe library' , stream base , sharp library )
// resource route component
import React from "react";
import { PassThrough } from "node:stream"
import fs from "node:fs"
import {createReadableStreamFromReadable} from "@remix-run/node"
import { defaultQuality,widths,mainImageReadStream,generatedImageReadstream, isThereImage,BadImageResponse } from "../../util/image.server"
export const loader = async ({ request }) => {
const url = new URL(request.url);
const src = url.searchParams.get("src");
@prescottprue
prescottprue / jest-to-vitest.sh
Last active November 27, 2024 02:14
Replace Jest With Vitest
#!/bin/bash
# Based off https://gist.github.com/wojtekmaj/6defa1f358daae28bd52b7b6dbeb7ab6 with a few fixes and
# additions/removals including no git interactions
join_by() {
local d=${1-} f=${2-}
if shift 2; then
printf %s "$f" "${@/#/$d}"
fi