Skip to content

Instantly share code, notes, and snippets.

View h-jennings's full-sized avatar

Hunter Jennings h-jennings

View GitHub Profile
@h-jennings
h-jennings / karabiner.edn
Last active February 13, 2025 14:39
Karabiner edn file
;; ! | means mandatory
;; # | means optional
;; C | left_command
;; T | left_control
;; O | left_option
;; S | left_shift
;; F | fn
;; Q | right_command
;; W | right_control
;; E | right_option
@h-jennings
h-jennings / some-helpful-ts-utils.ts
Last active November 4, 2021 15:12
Helpful TS utils
type ArrayItemType<T extends unknown[]> = T extends unknown[]
? T extends (infer U)[]
? U
: never
: never;
type Entries<T> = {
[K in keyof T]: [K, T[K]];
}[keyof T][];
import { createVar, style } from '@vanilla-extract/css';
import { calc } from '@vanilla-extract/css-utils';
export const gridColumnCount = createVar();
export const gridItemMinWidth = createVar();
export const gridLayoutGapX = createVar();
export const gridLayoutGapY = createVar();
export const gapCount = createVar();
export const totalGapWidth = createVar();
export const gridItemMaxWidth = createVar();
const AudioPrimitiveContext = React.createContext<InterpreterFrom<
typeof audioMachine
> | null>(null);
export const AudioPrimitiveProvider = ({
children,
}: {
children?: React.ReactNode;
}) => {
const [machine] = React.useState(() => {
@h-jennings
h-jennings / Tooltip.tsx
Last active June 4, 2024 17:24
Linear-style tooltip UX with Radix UI Primitives
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
import * as React from 'react';
import { twMerge } from 'tailwind-merge';
/**
* With this component, if the user moves the cursor between tooltip group, the
* delay is set to 0, this makes the next tooltip appear immediately.
*/
export const TooltipGroup = React.forwardRef<
HTMLDivElement,