Override prefers-color-scheme
via CDP
let Main = await import('./entrypoints/main/main.js')
await Main.MainImpl.sendOverProtocol("Emulation.setEmulatedMedia", { features: [{ name: "prefers-color-scheme", value: "dark" }] })
Override prefers-color-scheme
via CDP
let Main = await import('./entrypoints/main/main.js')
await Main.MainImpl.sendOverProtocol("Emulation.setEmulatedMedia", { features: [{ name: "prefers-color-scheme", value: "dark" }] })
type PropKey = string | number; | |
type PropValue = null | undefined | number | boolean | string | Date; | |
export function toPropPathMap(input: unknown) { | |
const output = new Map<PropKey[], PropValue>(); | |
function traverse(v: unknown, keys: PropKey[]) { | |
// prettier-ignore | |
if ( | |
typeof v === "undefined" || |
/* | |
$ node hangle-syllables.js | |
가 : ㄱ ㅏ | |
각 : ㄱ ㅏ ㄱ | |
갂 : ㄱ ㅏ ㄲ | |
갃 : ㄱ ㅏ ㄳ | |
간 : ㄱ ㅏ ㄴ | |
갅 : ㄱ ㅏ ㄵ | |
갆 : ㄱ ㅏ ㄶ |
#!/bin/bash | |
set -eu -o pipefail | |
# | |
# something similar to https://github.com/marcosnils/bin but for simple shell scripts on gist | |
# | |
# usage: | |
# bash bin-gist.sh https://gist.github.com/hi-ogawa/1e0b1a147e883aad41f97c68246f3c33 bin-gist.sh | |
# bash bin-gist.sh https://gist.github.com/hi-ogawa/bca49e90241f7808127a430f986d33ea passphrase.sh | |
# |
#!/bin/bash | |
set -eu | |
# | |
# usage: | |
# $ bash passphrase.sh | |
# amusement-twelve-pusher-gilled-excuse | |
# | |
# references |
import { chromium, Page } from "playwright-chromium"; | |
import process from "node:process"; | |
// this specific example is made to extract the list of spot trade coins on ByBit | |
// usage: | |
// node -r esbuild-register playwirhgt-for-scraping.ts --headed | |
// note: | |
// "page.pause" with "--headed" allows the same debugging experience as playwright testing. |
# it seems aws-cli-v2-bin is deleted from aur. I extracted PKGBUILD from yay cache just in case. | |
# Maintainer: Steve Engledow <[email protected]> | |
pkgname=aws-cli-v2-bin | |
pkgver=2.8.3 | |
pkgrel=1 | |
pkgdesc='Universal Command Line Interface for Amazon Web Services version 2' | |
arch=('aarch64' 'x86_64') | |
url='https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html' | |
license=('Apache') |
/* eslint-disable no-console */ | |
// | |
// usage: | |
// npm i -D jscodeshift @types/jscodeshift recast | |
// npx jscodeshift --parser tsx --transform patch-transaction-editable.ts (...files) | |
// | |
/* | |
//// example input //// |
// | |
// example: | |
// <button onClick={useDebouncedFunction(() => console.log("debounced?"), 500)} /> | |
// | |
export function useDebouncedFunction<T extends (...args: any[]) => void>( | |
original: T, | |
ms: number | |
): (...args: Parameters<T>) => void { | |
const [call, setCall] = React.useState<() => void>(); |
For example, extract ant-design's color theme (V4) in
git clone [email protected]:ant-design/ant-design.git
cd ant-design
# read from stdin