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 ordgroupIterable<reference, key>( | |
refs: Accessor<Iterable<reference>>, | |
keyFn: (ref: reference) => key | |
): Accessor<ReadonlyMap<key, Accessor<readonly reference[]>>> { | |
const signals = createMemo((keyset: Map<key, Signal<readonly reference[]>>) => { | |
const exists = new Set(); | |
let changed = false; | |
// Check for group creations | |
const ord: 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
#!/bin/bash | |
set -euo pipefail | |
shopt -s lastpipe | |
name="temporary-vault" | |
already_set_path= | |
path="$(pwd)" | |
_usage() { | |
local status=${1:-0} |
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
(?(DEFINE) | |
(?<S>[\x20\x9\xD\xA]+) | |
(?<NameStartChar>[A-Za-z:_\xC0-\xD6\x{D8}-\x{F6}\x{F8}-\x{2FF}\x{370}-\x{37D}\x{37F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}-\x{EFFFF}]) | |
(?<NameChar>(?&NameStartChar)|[\-\.0-9\x{B7}\x{0300}-\x{036F}\x{203F}-\x{2040}]) | |
(?<Name>(?&NameStartChar)(?&NameChar)*) | |
(?<EntityRef>&(?&Name);) | |
(?<PercRef>%(?&Name);) | |
(?<Reference>(?&EntityRef)|(?&PercRef)) | |
(?<AttValue>"(?:[^<&"]|(?&Reference))*"|'(?:[^<&']|(?&Reference))*'|[^"'`=<>\x20\x9\xD\xA]+) | |
(?<Attribute>(?&Name)(?:=(?:(?&AttValue))?)?) |
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 { dedent } from "./dedent.ts" | |
for(let i = 0; i < 10; i++) { | |
console.log(dedent` | |
Hello, World! | |
this block of text gets unindented | |
interpolation works: ${i} | |
enjoy! | |
```) | |
} |
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 RFC9457ProblemOccurrence = { | |
/** | |
* A string containing a URI reference that identifies the problem type. | |
* | |
* Consumers MUST use this URI (after resolution, if necessary) as the problem type's | |
* primary identifier. | |
* | |
* When this member is not present, its value is assumed to be "about:blank". | |
* | |
* If the URI is a locator (e.g., those with an "http" or "https" scheme), |
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 { useCallback, Reducer, Dispatch, useState, useMemo, useEffect, useRef } from 'react'; | |
type Batch<S, A extends object> = { | |
state: S, | |
actions: A[], | |
next: Batch<S, A> | null | |
} | |
class StreamReducer<S, A extends object> { | |
/** |
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
mkdir -p dev.mongodb/{0,1,2}; rm -f dev.mongodb/{0,1,2}/log.*; | |
( | |
for i in {1..100}; do | |
socat -u OPEN:/dev/null UNIX-CONNECT:./dev.mongodb/0/.sock 2>/dev/null && break; | |
sleep 0.1; | |
done; | |
exec mongosh 'mongodb://.%2Fdev.mongodb%2F0%2F.sock' --eval "$(cat << EOF | |
const reinitiate = (() => { |
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 -S nginx -e /dev/stderr -p . -c | |
# Run an NGINX instance serving the current directory on ports 8080 and 8443 | |
# (when configured). Execute one of the following commands in the terminal. | |
# - start-nodaemon: ./nginx.conf -g 'daemon off;' | |
# - start: ./nginx.conf | |
# - stop: ./nginx.conf -s stop | |
# - reload: ./nginx.conf -s reload | |
pid .nginx/nginx.pid; | |
events {} |
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
const Benchmark = require('benchmark'); | |
const suite = new Benchmark.Suite; | |
class Base { | |
type = "base" | |
} | |
class Child extends Base { | |
type = "child" | |
} |
NewerOlder