/window merge all
/eval /window splith ${calc:8 / ${window[gui_current_window].win_height} * 100 // 1}
/buffer add -switch highmon
/window splitv 40
/buffer ##news
/window splitv 75
/buffer exec.conky
import { exec } from 'child_process'; | |
import { readFile, writeFile } from 'node:fs/promises'; | |
import path from 'node:path'; | |
import { promisify } from 'util'; | |
import * as YAML from 'yaml'; | |
const execAsync = promisify(exec); | |
// update package.json imports.types path to point to the source file | |
/** |
// manually loading a module with only public apis | |
type ModuleBody = ( | |
exports: object, | |
require: NodeRequire, | |
module: Module, | |
filename: string, | |
dirname: string, | |
) => void; |
interface EventEmitterOn { | |
on(event: string, listener: (...args: any) => void): any; | |
} | |
type EventNames<T extends EventEmitterOn> = T extends { | |
on(event: infer N1, listener: any): any; | |
on(event: infer N2, listener: any): any; | |
on(event: infer N3, listener: any): any; | |
on(event: infer N4, listener: any): any; | |
on(event: infer N5, listener: any): any; | |
on(event: infer N6, listener: any): any; |
{ | |
"$ref": "#/definitions/Settings", | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"definitions": { | |
"AccessibilitySettings": { | |
"additionalProperties": false, | |
"properties": { | |
"disableLoadingPhrases": { | |
"type": "boolean" | |
} |
import type { Primitive } from 'type-fest'; | |
interface TypeguardTuple<T> extends Omit<readonly [T, ...T[]], never> { | |
includes(searchElement: unknown): searchElement is T; | |
includes(searchElement: T, fromIndex?: number): boolean; | |
} | |
const typeguardTuple = <T extends Primitive>(tuple: readonly [T, ...T[]]) => | |
tuple as Omit<readonly [T, ...T[]], never> as TypeguardTuple<T>; |
import { ObjectId } from 'bson'; | |
export class ObjectIdSet { | |
map = new Map<number, Set<number>>(); | |
constructor(values: Iterable<ObjectId>) { | |
for (const value of values) { | |
this.add(value); | |
} | |
} | |
add(value: ObjectId): this { |
const port = process.argv[2]; | |
const host = process.argv[3]; | |
const delay = 1000; | |
const socket = new net.Socket(); | |
socket.on('close', () => { | |
setTimeout(() => { | |
socket.connect(port, host); | |
}, delay); | |
}); |
function analyseObjectId(/** @type {import('bson').ObjectId} */ oid) { | |
const randomidBuffer = Buffer.from( | |
oid.buffer.buffer, | |
oid.buffer.byteOffset + 4, | |
5, | |
); | |
const counterBuffer = Buffer.alloc(4); | |
oid.buffer.copy(counterBuffer, 1, 9); | |
return { | |
timestamp: oid.buffer.readInt32BE(0), |
// just for hacking about in the node.js repl | |
PackFileCacheStrategy = require('webpack/lib/cache/PackFileCacheStrategy') | |
logger = Object.assign(Object.create(console), {getChildLogger() { return this }}) | |
cacheLocation = '.angular/cache/17.3.8/angular-webpack/INSERT_HASH_HERE' | |
packStrategy = new PackFileCacheStrategy({version: '', cacheLocation, fs, compiler: { options: { output: {} } }, snapshot: {}, logger}); | |
pack = await packStrategy.packPromise |