Skip to content

Instantly share code, notes, and snippets.

View amosbastian's full-sized avatar
🚀

Amos Bastian amosbastian

🚀
View GitHub Profile
@BurnedChris
BurnedChris / benchmark-satori.ts
Last active March 12, 2026 23:13
Benchmark scripts for takumi and satori
//✓ Generated 87 OG images using Vercel OG: docs-new-layout/.c15t → /docs-new-layout/public/og
// ⏱️ Total time: 71725ms (1m)
// 📊 Performance: 3214.4882352941177ms (3s) - avg per image
// 🚀 Throughput: 1.21 images/second
import fs from 'node:fs';
import { cpus } from 'node:os';
import path from 'node:path';
import { ImageResponse } from '@vercel/og';
import ms from 'ms';
import React from 'react';
import { Router } from 'next/router';
import { useEffect } from 'react';
import { publicConfig } from '~/shared/config';
import { trpc } from '~/utils/trpc';
let initVersion = publicConfig.GIT_COMMIT;
function useDetectVersionChange() {
const healthQuery = trpc.health.useQuery(undefined, {
refetchInterval: 10_000,
@TheThirdRace
TheThirdRace / Image.tsx
Last active February 6, 2024 15:20
Image component: merge Chakra-ui `2.8.0` with NextJs `13.4.13` and remove most pain points
/**
* # `<Image>`
*
* This component is a merge between `next/image` and `Chakra-ui`.
* - last updated on 2023-08-08 with `next/image` 13.4.13 and `chakra-ui/react` 2.8.0
* - https://github.com/vercel/next.js/blob/v13.4.13/packages/next/src/client/image-component.tsx
* - https://github.com/vercel/next.js/blob/canary/packages/next/src/client/image-component.tsx
* - https://github.com/vercel/next.js/commits/canary/packages/next/src/client/image-component.tsx
* - https://github.com/vercel/next.js/compare/v13.4.4...canary
*
@jpagand
jpagand / CoronaproverAvailabilityFinder.md
Last active December 16, 2020 13:19
Coronaprover availability finder

Coronaprover availability finder

This script will help you the find an available time slot for a covid test on coronaprover.dk

Installation

This script only work on Google chrome

@baumandm
baumandm / Chakra-UI x React-datepicker.md
Last active November 21, 2025 07:55
Chakra-UI x React-datepicker

⚠️ I'd recommend using this fork by @igoro00 which has better theme support.


Tiny wrapper component for React-Datepicker to stylistically fit with Chakra-UI 1.x.

<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} />
@basham
basham / css-units-best-practices.md
Last active January 18, 2026 02:03
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units