Skip to content

Instantly share code, notes, and snippets.

Enable dark mode on Windows 10

  1. Press Windows Key + R, type regedit, and press Enter.
  2. Navigate to the following path: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize
  3. Locate the AppsUseLightTheme DWORD value. Double-click it and change the Value data to 0.
  4. Locate the SystemUsesLightTheme DWORD value. Double-click it and change the Value data to 0.
export function loopFunction<S, T>(
fn: (this: S, item: T) => any,
): (this: S, ...items: T[]) => void {
return function (this: S, ...items: T[]) {
for (const item of items) {
try {
fn.call(this, item);
} catch (e) {}
}
};
export async function fetchStream(
url: RequestInfo | URL,
handler: (text: string) => any,
): Promise<Response> {
const response = await fetch(url);
(async () => {
const reader = response.body!.getReader();
const decoder = new TextDecoder();
let buffer = "";
while (true) {
export function mapRecord<K extends string, V1, V2>(
input: Record<K, V1>,
mapper: (value: V1, key: K) => V2,
): Record<K, V2> {
const entries = Object.entries(input).map(([key, value]) => [key, mapper(value as V1, key as K)]);
return Object.fromEntries(entries);
}
#!/usr/bin/env bash
# Usage: rgb [Red 0-5] [Green 0-5] [Blue 0-5]
c=$((16+(${1:-0}*36)+(${2:-0}*6)+(${3:-0}*1)))
if [[ -t 1 ]]
then printf '\e[38:5:%dm%-3d\e[m\n' $c $c
else echo $c
fi
#titlebar,
#toolbar-menubar {
display: none !important;
}
#TabsToolbar {
--height: 42px;
height: var(--height) !important;
transition: margin-bottom 200ms !important;
&:not(:has(#tabbrowser-arrowscrollbox tab ~ tab)) /* single tab */ {
export interface Observer<T> {
update(value: T): void;
}
export interface Observable<T> {
observe(observer: Observer<T>): Abortable;
}
export interface Abortable {
abort(): void;
#!/bin/bash
set -euo pipefail
main() {
install_deps
write_config
reload_wlmod
connect_wifi
echo SUCCESS
}
[p]=document.getElementsByTagName("player")
for(let parent=p.parentElement;parent;parent=parent.parentElement)
for(let c of parent.children) (c!=p&&!c.contains(p)) && (c.style='pointer-events:none!important;z-index:1'))
p.style='z-index:99;position:fixed;left:50%;top:50%;translate:-50% -50%;max-width:100vw;max-height:100vh;width:100%'
#!/usr/bin/env bash
[[ -z "$PORT" ]] && PORT=18181
[[ -z "$SAMPLING" ]] && SAMPLING=44100
help() {
printf 'Usage: ffstream %s\n' 'receive' 'send <address>'
}
operator=$1