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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"os/exec" |
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
sudo cryptsetup luksOpen /dev/nvme0n1p3 cryptdata | |
sudo lvscan | |
sudo vgchange -ay | |
sudo mount /dev/mapper/data-root /mnt | |
sudo mount /dev/nvme0n1p1 /mnt/boot/efi | |
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done | |
sudo cp /etc/resolv.conf /mnt/etc/ | |
sudo chroot /mnt |
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
export class WrappedError<ErrKind = any> extends Error implements Iterable<WrappedError | ErrKind> { | |
previous: ErrKind | null = null; | |
guid: Guid; | |
constructor(message: string, previous?: ErrKind) { | |
super(message); | |
// We update the error's name to distinguish it from the base Error. | |
this.name = this.constructor.name; | |
this.guid = `<${this.name}:empty>`; | |
// We add our reference to the original error value (if provided). |
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
/** | |
* Creates a mapped type from the `Subject` | |
* that excludes all members with types | |
* that extend the `ExcludeType`. | |
*/ | |
type ExcludeBy<Subject, ExcludeType> = { | |
[P in { | |
[K in keyof Subject]: Subject[K] extends ExcludeType ? never : K | |
}[keyof Subject]]: Subject[P] | |
}; |
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
Screen 0: minimum 8 x 8, current 5760 x 2160, maximum 32767 x 32767 | |
HDMI-0 disconnected (normal left inverted right x axis y axis) | |
DP-0 disconnected (normal left inverted right x axis y axis) | |
DP-1 disconnected (normal left inverted right x axis y axis) | |
DP-2 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 597mm x 336mm | |
3840x2160 60.00*+ 29.98 | |
2560x1440 59.95 | |
1920x1200 59.88 | |
1920x1080 60.00 59.94 50.00 23.98 | |
1680x1050 59.95 |
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
port async function idleMap<Item, Output>( | |
iterable: Iterable<Item>, | |
op: (item: Item) => Promise<Output> | |
): Promise<Output[]> { | |
return new Promise((resolve) => { | |
let iter = iterable[Symbol.iterator](); | |
let buf: Output[] = []; | |
async function process(deadline: RequestIdleCallbackDeadline) { | |
do { |
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
window[Symbol.for("@@support.IntersectionObserver")] = (function(w, k) { | |
let y = k.io in w && k.en in w && k.ra in w[k.en][k.pr]; | |
if (!y) { | |
return false; | |
} | |
if (!(k.ix in w[k.en][k.pr])) { | |
Object.defineProperty(w[k.en][k.pr], k.ix, { | |
get() { | |
return this[k.ra] > 0; | |
}, |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Change Event</title> | |
<style> | |
body { |
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
:root { | |
--base-unit: 1rem; | |
--margin: var(--base-unit); | |
} | |
.m { | |
margin-top: var(--margin-top, var(--margin-y, var(--margin))); | |
margin-right: var(--margin-right, var(--margin-x, var(--margin))); | |
margin-bottom: var(--margin-bottom, var(--margin-y, var(--margin))); | |
margin-left: var(--margin-left, var(--margin-x, var(--margin))); |
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
export class Bits { | |
static get Nil() { | |
return 0; | |
} | |
static get All() { | |
// Flip the sign bit out of all bits engaged. | |
return ~0 ^ (1 << 31); | |
} |
NewerOlder