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 { ComponentProps, forwardRef, SVGAttributes } from 'react'; | |
import { styled } from 'stitches.config'; | |
import { IconName } from './generated/iconNames'; | |
export interface IconProps extends ComponentProps<typeof StyledSvg> { | |
name: IconName; | |
} | |
export const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon( |
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
Show hidden characters
{ | |
"TS React FC": { | |
"scope": "typescriptreact", | |
"prefix": "rfc", | |
"body": [ | |
"export interface ${1:${TM_FILENAME/(.*)\\..+$/$1/}}Props {", | |
" $2", | |
"}", | |
"", | |
"export function $1({ $3 }: $1Props) {", |
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 { | |
LiveList, | |
LiveMap, | |
LiveObject, | |
Lson, | |
LsonObject, | |
} from '@liveblocks/client'; | |
type ExtractObjectShape<T extends LiveObject<LsonObject>> = | |
T extends LiveObject<infer U> ? U : never; |
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 { LiveList, LiveMap, LiveObject, Presence } from '@liveblocks/client'; | |
import { useRoom } from '@liveblocks/react'; | |
import { useState, useEffect, useMemo, useRef } from 'react'; | |
import invariant from 'tiny-invariant'; | |
import { useAsset } from 'use-asset'; | |
export function useRoot() { | |
const room = useRoom(); | |
// suspend until root storage is ready | |
const { root } = useAsset((r) => { |
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
apiVersion: cert-manager.io/v1 | |
kind: Certificate | |
metadata: | |
name: livekit-cert | |
spec: | |
secretName: livekit-tls | |
dnsNames: | |
- livekit.your.domain.com | |
issuerRef: | |
name: letsencrypt-production |
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
// various tmp vars to avoid allocation in frame loop | |
const frameMovement = new Vector3(); | |
const frameRotation = new Euler(); | |
const tempQuat = new Quaternion(); | |
const tempQuat2 = new Quaternion(); | |
const tempForward = new Vector3(); | |
const tempRight = new Vector3(); | |
const tempUp = new Vector3(); | |
function useShipControls(api: RAPIER.RigidBody) { |
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
var controller = new AbortController(); | |
fetch('/', { signal: controller.signal }) | |
.then(res => res.text()) | |
.then(text => console.log(text)); | |
// busywait for a while, should keep the thread busy until the request | |
// completes. | |
let i = 0; while (i < 100000) { | |
i++; | |
console.log(i); |
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
Process: Color Picker [4360] | |
Path: /Applications/Color Picker.app/Contents/MacOS/Color Picker | |
Identifier: com.sindresorhus.Color-Picker | |
Version: 1.5.0 (14) | |
App Item ID: 1545870783 | |
App External ID: 842742849 | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: Color Picker [4360] | |
User ID: 501 |
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
Some messages have been moved to the Issues panel. | |
index.js:31900 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu | |
173 @ index.js:31900 | |
o @ index.js:1 | |
(anonymous) @ index.js:1 | |
171../browser @ index.js:31410 | |
o @ index.js:1 | |
r @ index.js:1 | |
(anonymous) @ index.js:1 | |
index.js:26667 2021-04-06T14:07:37.885Z info [connect #1] Connecting to a Room |
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 { ComponentOf, ComponentType, query, Selector } from '@javelin/ecs'; | |
import { useEffect, useRef, useState } from 'react'; | |
import { useWorld } from './useWorld'; | |
function compareIdLists(a: number[], b: number[]) { | |
return a.sort().join('') === b.sort().join(''); | |
} | |
export function useEntities(...filters: Selector) { | |
const [entities, setEntities] = useState<number[]>([]); |
NewerOlder