Skip to content

Instantly share code, notes, and snippets.

Reach UI Philosophy

Reach UI is an accessible foundation for React applications and design systems.

The three equally important goals are to be:

  • Accessible
  • Composable
  • Stylable
import PropTypes from 'prop-types';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Defined<T> = T extends undefined ? never : T;
/**
* Get the type that represents the props with the defaultProps included.
*
* Alternatively, we could have done something like this:
@ebidel
ebidel / download_chrome41.js
Last active February 14, 2024 01:56
For when you need to test your site in Google Search (Chrome 41).
/**
* Copyright 2018 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@swyxio
swyxio / Gatsby-bootstrap-lifecycle.md
Last active April 1, 2022 11:19
Gatsby bootstrap lifecycle

Sequence of Gatsby's bootstrap lifecycle with links to source code as of v2.0.0

  1. open and validate gatsby-config (get-config-file.js) 1.5 load themes (swyx added this note July 2019)
  2. load plugins (load-plugins/index.js) from the list given in gatsby-config.js
  3. onPreBootstrap: runs onPreBootstrap if it is implemented in any plugins, for example gatsby-plugin-typography. Receives handy [apiCallArgs](https://github.com/gatsbyjs/gatsby/blob/ffd8b2d691c9
@stevekinney
stevekinney / web-performance.md
Last active October 18, 2025 12:22
Web Performance Workshop

Web Performance

Requirements

Repositories

@ebidel
ebidel / coverage.js
Last active October 18, 2025 09:48
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@ebidel
ebidel / sw_caching_size.js
Last active November 16, 2022 11:31
Print service worker cache sizes and overall bytes cached.
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*/
// Prints the bytes cached by service worker. Breaks out each cache
// overall in-memory bytes used by the Cache Storage API for the site.
async function getCacheStoragesAssetTotalSize() {
// Note: opaque (i.e. cross-domain, without CORS) responses in the cache will return a size of 0.
import { something, defined, TypeGuard, FunctionCall0, FunctionCall1, FunctionCall2, FunctionCall3, FunctionCall4 } from "./UtilityTypes";
import { isObject, whatever } from "./index";
/**
* Maybe.ts - A TypeScript implementation of the Maybe Monad.
* ==========================================================
*
* Usually a Maybe is strong type with methods, but that approach, I felt,
* would lead to poor performance characteristics and also not take full
* advantage of TypeScript's specific approach to types using type guards.
@nkavadias
nkavadias / pi-hole-workshop-instructions-using-Rpi.md
Last active March 25, 2024 14:45
Raspberry Pi instructions for Pi-hole setup