- When customizing stick to the design system
- Small learning curve
- They have component-based design in mind
- Upcoming NextJS, built-in Tailwind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local random = math.random | |
local function newMap(width, height, mines) | |
local map, symbol, hide = {}, {}, {} | |
for x = 1, width do | |
map[x] = {} | |
symbol[x] = {} | |
hide[x] = {} | |
for y = 1, height do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function serialize(source) { | |
const refs = []; | |
const assignments = []; | |
function checkRef(current) { | |
const index = refs.indexOf(current); | |
if (index === -1) { | |
refs.push(current) | |
return { first: true, index: refs.length - 1}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SWROptions { | |
revalidateOnVisibility?: boolean; | |
revalidateOnNetwork?: boolean; | |
revalidateOnFocus?: boolean; | |
} | |
function createSWRResource<T>( | |
data: Resource<T>, | |
refetch: () => void, | |
options: SWROptions, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query IntrospectionQuery { | |
__schema { | |
queryType { | |
name | |
} | |
mutationType { | |
name | |
} | |
subscriptionType { | |
name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Collect<T, O extends string, C extends string, S extends string, R extends any[] = []> = | |
T extends `${C}${infer Rest}` | |
? Collect<Rest, Rest, C, S, [any, ...R]> | |
: `${S}(${R['length']});${Compile<O>}`; | |
type Compile<T> = | |
T extends `+${infer Rest}` | |
? Collect<T, Rest, '+', 'c'> | |
: | |
T extends `-${infer Rest}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Head from 'next/head'; | |
const CDN_BASE = 'https://cdn.jsdelivr.net/npm/'; | |
const PACKAGE_NAME = '@zoomus/websdk'; | |
const PACKAGE_VERSION = '1.8.1'; | |
const PACKAGE_DIR = `${CDN_BASE}${PACKAGE_NAME}@${PACKAGE_VERSION}`; | |
const ZOOM_DIR = '/dist/lib'; | |
const AV_DIR = '/av'; | |
const VERSION_PREFIX = '5793_'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from 'react'; | |
export type Dispose = () => void; | |
export default function useDispose(dispose: Dispose): void { | |
const timeout = setTimeout(dispose, 64); | |
useEffect(() => { | |
clearTimeout(timeout); | |
}, [timeout]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MutableRefObject } from 'react'; | |
import useIsomorphicEffect from './useIsomorphicEffect'; | |
export type ContainerQuery = | |
| 'width' | |
| 'height' | |
| 'max-width' | |
| 'max-height' | |
| 'aspect-ratio' | |
| 'orientation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type AsyncCallback<T extends any[]> = (...args: T) => Promise<void>; | |
export type DebouncedAsync<T extends any[]> = (...args: T) => void; | |
export function debounceAsync<T extends any[]>(callback: AsyncCallback<T>, duration: number): DebouncedAsync<T> { | |
let lifecycle: PromiseLifecycle; | |
let timeout: number; | |
function control(...args: T) { | |
if (timeout) { | |
lifecycle.alive = false; |
NewerOlder