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 { execa } from "execa"; | |
import * as path from "path"; | |
import { fileURLToPath, pathToFileURL } from "url"; | |
import express from "express"; | |
import bodyParser from "body-parser"; | |
import * as crypto from "crypto"; | |
import * as fs from "fs/promises"; | |
const urlencodedParser = bodyParser.urlencoded(); |
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 registerKeyHoldEvent(key, onChange) { | |
const handleKeyDown = (evt) => { | |
if (evt.key === key) { | |
onChange(true); | |
document.removeEventListener("keydown", handleKeyDown); | |
const handleKeyUp = (evt) => { | |
if (evt.key === key) { | |
onChange(false); | |
document.removeEventListener("keyup", handleKeyUp); | |
registerKeyHoldEvent(element, key); |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
/** | |
* @flow | |
*/ | |
import * as React from "react"; | |
import { unstable_createResource } from "react-cache"; | |
import * as Scheduler from "scheduler"; | |
import { StorageArea } from "std:kv-storage"; | |
// Creates a ref that tracks the latest value of the argument passed to it |
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
/** | |
* @flow | |
*/ | |
import * as React from "react"; | |
type SafeAreaInsetsContextType = $ReadOnly<{| | |
top: number, | |
left: number, | |
right: number, |
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
/** | |
* @flow | |
*/ | |
opaque type Ruleset = { [string]: string | number }; | |
type CreateInput = { | |
[styleName: string]: CSSProperties | |
}; |
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
/** | |
* @flow | |
*/ | |
import VisuallyHidden from "@reach/visually-hidden"; | |
import instyle from "instyle"; | |
import * as React from "react"; | |
import { Focus } from "react-events/focus"; | |
import { Drag } from "react-events/drag"; | |
import { Press } from "react-events/press"; |
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
// @flow | |
import * as React from "react"; | |
const DEFAULT_PIXEL_RATIO = 1; | |
function processPixelRatio(input: ?number): number { | |
return input ?? DEFAULT_PIXEL_RATIO; | |
} | |
// matchMedia feature detection |
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
#!/usr/bin/env bash | |
set -e | |
# usage: | |
# $ ./encode.sh [INPUT_FILE] | |
# | |
# NOTE: The output directory is defined in the script (below) because I use this script with Hazel | |
# START CONFIGURATION ================== |
NewerOlder