Update: Ariakit Styles is in alpha. If you want to try it, join us on Discord (see the #news channel).
| /* | |
| * SIMD JavaScript/TypeScript lexer for x86-64 AVX2, tuned for AMD Zen 3 <<< IMPORTANT | |
| * | |
| * CccLex L = {0}; | |
| * uint8_t *buf = ccc_source_alloc(n); // 64-byte aligned, 64B zero-padded | |
| * memcpy(buf, bytes, n); | |
| * size_t ntok = ccc_lex(&L, buf, n); // tokens: L.starts[i], L.kinds[i] | |
| * ccc_source_free(buf); | |
| * ccc_free(&L); | |
| * |
| nr() { | |
| node_version=$(node -v) | |
| major=$(echo $node_version | cut -c 2-3) | |
| if [[ $(($major)) -gt 21 ]] | |
| then | |
| echo "node $node_version, using node --run $@ ⚡\n" | |
| node --run $@ | |
| else | |
| echo "node $node_version, using npm run $@\n" | |
| npm run $@ |
| export async function BlueSkyPost() { | |
| const url = new URL('https://bsky.app/profile/danabra.mov/post/3la62zxt4rs2j'); | |
| const details = url.pathname.split('/').filter(Boolean).reduce((acc, part, index, pathParts) => { | |
| if (index % 2 === 0 && pathParts[index + 1]) { | |
| acc[part] = pathParts[index + 1]; | |
| } | |
| return acc; | |
| }, {} as Record<'post' | 'profile' | string, string>); | |
| const endpoint = new URL('https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread'); | |
| const params = new URLSearchParams(); |
Using TransformStream in place of traditional queue implementations is an interesting approach that leverages the stream API's natural queuing and backpressure features. Below is a breakdown of how you might implement each queue type using TransformStream, adhering to the constraint of using no more than 2 TransformStreams per queue, and addressing any limitations that arise.
- Implementation:
- TransformStream 1: This stream simply passes data from the writable side to the readable side in FIFO order.
- TransformStream 2: Not necessary in this case, as one
TransformStreamis sufficient to maintain the FIFO order.
const fifoQueue = new TransformStream(undefined, undefined, { highWaterMark: Infinity });| import path from 'path'; | |
| import { fileURLToPath } from 'url'; | |
| import comments from '@eslint-community/eslint-plugin-eslint-comments/configs'; | |
| import { fixupConfigRules } from '@eslint/compat'; | |
| import { FlatCompat } from '@eslint/eslintrc'; | |
| import js from '@eslint/js'; | |
| import eslintConfigPrettier from 'eslint-config-prettier'; | |
| import jsdoc from 'eslint-plugin-jsdoc'; | |
| import * as regexpPlugin from 'eslint-plugin-regexp'; |
| // original https://github.com/babel/babel/blob/9c77558234c87b9220604fbc1519089e2d6334e2/packages/babel-traverse/src/scope/lib/renamer.ts#L61 | |
| import splitExportDeclaration from '@babel/helper-split-export-declaration' | |
| import type { Scope } from '@babel/traverse' | |
| import { visitors } from '@babel/traverse' | |
| import { traverseNode } from '@babel/traverse/lib/traverse-node' | |
| import * as t from '@babel/types' | |
| import { NodePath, Visitor } from '@babel/core' | |
| import type { Identifier } from '@babel/types' |
| import Benchmark from "benchmark"; | |
| const datetimeValidationSuite = new Benchmark.Suite("datetime"); | |
| const DATA = "2020-01-01"; | |
| const MONTHS_31 = new Set([1, 3, 5, 7, 8, 10, 12]); | |
| const MONTHS_30 = new Set([4, 6, 9, 11]); | |
| const simpleDatetimeRegex = /^(\d{4})-(\d{2})-(\d{2})$/; | |
| const datetimeRegexNoLeapYearValidation = |
This setup uses some tricks to ensure that the right email/name/ssh-key is used for the right repos without having to think about it ever again.
- First generate two SSH keys,
~/.ssh/id_ed25519and~/.ssh/id_ed25519_work - Add one key to your personal account and the other to your work account
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.
SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on