Skip to content

Instantly share code, notes, and snippets.

View amosbastian's full-sized avatar
🚀

Amos Bastian amosbastian

🚀
View GitHub Profile
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 March 4, 2023 20:56
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 April 29, 2024 10:40
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