https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API
https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Lifecycle
https://github.com/immersive-web/webxr/blob/master/explainer.md#what-is-webxr
#!/bin/bash | |
# Ensure we're working on the latest version of the main branch | |
git switch main | |
git fetch | |
git pull | |
# Create a new branch | |
git switch -c vitest |
export type Optional<T, U extends keyof T> = Partial<Pick<T, U>> & Omit<T, U>; |
let vars = new Map() | |
for (const [prop, val] of document.documentElement.computedStyleMap()) { | |
if (prop.startsWith('--')) { | |
vars.set(prop, val[0][0]) | |
} | |
} | |
for (const [k, v] of vars.entries()) { | |
console.log(`${k}: ${v}`) | |
} |
#!/bin/bash | |
# example usage: `$ ./get_input.sh 09` | |
echo "getting input file for day ${1}"; | |
PATH="input/${1}.txt"; | |
YEAR="2022"; | |
DAY=$(echo "${1}" | /usr/bin/sed 's/^0*//'); | |
URL="https://adventofcode.com/${YEAR}/day/${DAY}/input"; |
npm: | |
No package-lock.json, no node_modules: | |
(higher variance so I included multiple) | |
real 1m32.585s | |
user 1m9.851s | |
sys 0m38.996s |
const { chromium } = require("playwright"); // Or 'chromium' or 'firefox'. | |
(async () => { | |
const browser = await chromium.launch({ | |
channel: "chrome-canary", | |
args: ["--enable-unsafe-webgpu"], | |
headless: false, | |
}); | |
const context = await browser.newContext({ |
export type WithOptional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>; | |
export type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; | |
// expands object types recursively | |
export type ExpandRecursively<T> = T extends object | |
? T extends infer O | |
? { [K in keyof O]: ExpandRecursively<O[K]> } | |
: never | |
: T; |
import type * as Stitches from "@stitches/react"; | |
import { modifyVariantsForStory } from "../../../.storybook/type-utils"; | |
import { styled } from "../../stitches.config"; | |
const Example = styles("div", { | |
// ... | |
}); | |
export default Example; |
// Fetch the book data | |
var books = fetch('http://someaweomseapi.com/api') | |
.then(function(response){ | |
return response.json(); | |
}) | |
.then(function(json){ | |
console.log('fetch result:', json) | |
return json | |
}) |