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
# INSPECT | |
function inspect () { | |
eval NODE_OPTIONS="--inspect-brk" $@ | |
} | |
# INSPECT PLUGIN | |
# Toggles the "inspect " prefix upon double ESC key | |
function plugin-inspect () { |
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 proxy = new Proxy ( [0, 1, 2], { | |
get: ( ...args ) => { | |
console.log ( '[get]', ...args ); | |
return Reflect.get ( ...args ); | |
}, | |
apply: ( ...args ) => { | |
console.log ( '[apply]', ...args ); | |
return Reflect.apply ( ...args ); | |
}, |
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 */ | |
import {$$, createDirective} from 'voby'; | |
import {useUpdateEffect} from '~/hooks'; | |
/* HELPERS */ | |
const onCheckboxChange = ( target: HTMLInputElement, value: $<undefined | boolean | number | string>, onChange?: ( value: boolean | string ) => void ): void => { |
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 emojiRe = /(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F)(?:\u200d(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F))*/gu; |
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 */ | |
import benchmark from 'benchloop'; | |
import stringWidth from 'string-width'; | |
// import fastStringWidth from '../dist/index.js'; | |
/* HELPERS */ | |
const IMPLEMENTATIONS = [ |
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 */ | |
import benchmark from 'benchloop'; | |
import fs from 'node:fs'; | |
import path from 'node:path'; | |
import toIgnore from 'fast-ignore'; | |
import dotignore from 'dotignore'; | |
/* HELPERS */ |
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 */ | |
import {$} from 'voby'; | |
import {useCanvasOverlay, useEffect, useEventListener, useRect, useResolved} from '~/hooks'; | |
/* TYPES */ | |
type Line = { | |
offset: 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
- string_decoder | |
- 1.1.1 | |
- Repository: https://github.com/nodejs/string_decoder | |
- Readme: https://raw.githubusercontent.com/nodejs/string_decoder/master/README.md | |
- License: https://raw.githubusercontent.com/nodejs/string_decoder/master/LICENSE | |
- 1.3.0 | |
- Repository: https://github.com/nodejs/string_decoder | |
- Readme: https://raw.githubusercontent.com/nodejs/string_decoder/master/README.md | |
- License: https://raw.githubusercontent.com/nodejs/string_decoder/master/LICENSE | |
- source-map |
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 sieve = ( size ) => { | |
//TODO: add windowing for the buffer, allocating a fixed-size buffer that gets repopulated when needed | |
const buffer = new Uint8Array ( Math.ceil ( size / 8 ) ).fill ( 255 ); | |
const primes = []; | |
let prev = 2; |
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 */ | |
import {$$} from 'voby'; | |
import {useEffect} from '~/hooks'; | |
/* MAIN */ | |
const useResizeObserver = ( ref: $<Element | undefined>, fn: ResizeObserverCallback, options: ResizeObserverOptions = {} ): void => { |
NewerOlder