antimicro
authenticator
davinci-resolve
emoji-keyboard
grub2-editor-frameworks
grub2-theme-preview
hardcode-fixer-git
hardcode-tray
kotlin-native-bin
kwin-effect-shapecorners-git
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 regexp = (xs, ...ys) => (xs2, ...ys2) => | |
new RegExp( | |
String.raw(xs, ...ys).replace( | |
// Find additional escape sequences, | |
// spaces, line breaks, comments: | |
/\\[#\n ]|#.*$|[\n ]/gm, | |
// Remove spaces, line breaks, comments, | |
// unescape additional sequences: | |
x => (x[0] === '\\' ? x[1] : ''), | |
), |
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 DeepReadonly<T> = | |
T extends [infer A] ? DeepReadonlyObject<[A]> : | |
T extends [infer A, infer B] ? DeepReadonlyObject<[A, B]> : | |
T extends [infer A, infer B, infer C] ? DeepReadonlyObject<[A, B, C]> : | |
T extends [infer A, infer B, infer C, infer D] ? DeepReadonlyObject<[A, B, C, D]> : | |
T extends [infer A, infer B, infer C, infer D, infer E] ? DeepReadonlyObject<[A, B, C, D, E]> : | |
T extends [infer A, infer B, infer C, infer D, infer E, infer F] ? DeepReadonlyObject<[A, B, C, D, E, F]> : | |
T extends [infer A, infer B, infer C, infer D, infer E, infer F, infer G] ? DeepReadonlyObject<[A, B, C, D, E, F, G]> : | |
T extends (infer A)[] ? DeepReadonlyArray<A> : | |
T extends Function ? T : // can change to never to forbid functions |
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
ssh-keygen | |
Set-Alias ssh-agent "$env:ProgramFiles\git\usr\bin\ssh-agent.exe" | |
Set-Alias ssh-add "$env:ProgramFiles\git\usr\bin\ssh-add.exe" | |
Start-SshAgent -Quiet | |
ssh-add ~/.ssh/id_rsa | |
cat ~/.ssh/id_rsa.pub | Set-Clipboard |
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
su | |
mount /dev/nvme0n1p3 /mnt | |
mkdir /mnt/boot | |
mount /dev/nvme0n1p2 /mnt/boot | |
mkdir /mnt/boot/efi | |
mount /dev/nvme0n1p1 /mnt/boot/efi |
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
interface JsonArray extends Array<JsonValue> {} | |
interface JsonObject { | |
[key: string]: JsonValue; | |
} | |
export type JsonValue = null | boolean | number | string | JsonArray | JsonObject; |
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
su | |
mount /dev/sda4 /mnt | |
mkdir /mnt/boot | |
mount /dev/sda2 /mnt/boot | |
mkdir /mnt/boot/efi | |
mount /dev/sda1 /mnt/boot/efi |
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 zsh | |
while true; do | |
sleep 0.5 | |
xprop \ | |
-id "`xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5`" \ | |
-f _KDE_NET_WM_BLUR_BEHIND_REGION 32c \ | |
-set _KDE_NET_WM_BLUR_BEHIND_REGION 0 | |
done |
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
// Works exactly as `await`/`then` in JavaScript, but for types! | |
// Of course, it can’t handle deep nesting (≥45±n levels) due to | |
// TypeScript limitations. But 45 is enough. | |
// License: MIT. | |
type Await<a> = { | |
0: Await<a extends PromiseLike<infer b> ? b : never>, | |
1: a, | |
}[a extends PromiseLike<any> ? 0 : 1]; |
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 Falsy = '' | 0n | 0 | false | null | undefined | void; | |
type If<c, t, f> = c extends Falsy ? f : t; | |
type Cast<a, b> = a extends b ? a : b; | |
type Size<t> = t extends readonly any[] ? t['length'] : never; | |
type Head<t> = t extends readonly [any, ...any[]] ? t[0] : never; | |
type Last<t> = t extends readonly any[] ? t[Size<Tail<t>>] : never; | |
type Init<t, x = readonly []> = { 0: Init<Tail<t>, Append<x, Head<t>>>; 1: x }[If<Size<Tail<t>>, 0, 1>]; | |
type Append<t, e> = Concat<t, readonly [e]>; | |
type Reverse<t, x = readonly []> = { 0: Reverse<Tail<t>, Prepend<Head<t>, x>>; 1: x }[If<Size<t>, 0, 1>]; |
OlderNewer