Skip to content

Instantly share code, notes, and snippets.

View another-guy's full-sized avatar
💻
01001000 01000101 01001100 01001100 01001111

Igor Soloydenko another-guy

💻
01001000 01000101 01001100 01001100 01001111
View GitHub Profile
@another-guy
another-guy / openapi-fetch-with-pfx-certificate.ts
Created September 17, 2026 03:05
openapi-fetch-with-pfx-certificate.ts
The typed way is openapi-fetch's requestInitExt option combined with an undici Agent. There are no as casts and no any, and all of the certificate settings are type-checked by undici's own types.
// mtlsClient.ts
import { readFileSync } from "node:fs";
import createClient, { type Client } from "openapi-fetch";
import { Agent, type RequestInit as UndiciRequestInit } from "undici";
import type { paths } from "./generated/api"; // your openapi-typescript output
export interface MtlsClientOptions {
baseUrl: string;
@another-guy
another-guy / Prompt: diagnose the macOS plugin-does-not-persist issue
Created September 2, 2026 05:09
Prompt: diagnose the macOS plugin-does-not-persist issue
# Prompt: diagnose the macOS plugin-does-not-persist issue
Paste everything below the line into Claude Code on the macOS machine.
---
The kyrio plugin does not survive a restart on this Mac. Every time I quit Claude Code
and reopen it, the plugin is gone or switched off. The same plugin, from the same
marketplace, stays installed and enabled across restarts on two Windows machines.
Find the root cause and fix it for good.
@another-guy
another-guy / coderpad-test.ts
Last active August 22, 2024 04:42
coderpad test function
// TS
function test<T extends unknown>(actual: T, expected: T, text?: string): void {
function difference<D>(a: Set<D>, b: Set<D>) {
const arr: D[] = [];
a.forEach(d => arr.push(d));
return new Set<D>(arr.filter(x => !b.has(x)));
}
function same<S extends unknown>(o1: S, o2: S): boolean {
const t1 = typeof o1;
const t2 = typeof o2;
@another-guy
another-guy / simple-js-queue.js
Last active October 20, 2024 05:10
LeetCode: linked-list-based queue, more performant than default JS's array-based one
function createQueue() {
let head = undefined;
let tail = head;
function isEmpty() { return head === undefined; }
function push(value) {
const newElement = { next: undefined, value };
if (!tail) {
head = newElement;
tail = newElement;
@another-guy
another-guy / simple-js-stack.js
Last active August 21, 2024 22:44
LeetCode: linked-list-based stack, more performant than default JS's array-based one
function createStack() {
const empty = { next: undefined, value: undefined! };
let top = empty;
function isEmpty() { return top === empty; }
function push(v) { top = { next: top, value: v }; }
function pop() {
if (!top.next) throw new Error('Can not pop from empty');
const { value } = top;
top = top.next;
return value;
@another-guy
another-guy / time.learn.cantrill.io.js
Created April 25, 2024 19:50
learn.cantrill.io - time
function sumUp(t) {
const classes = t.split('\n').filter(l => l?.length > 9);
const r = /\((?<minutes>\d+)\:(?<seconds>\d+)(\s\))/;
const totalSeconds = classes
// parse each line
.map(s => r.exec(s)?.groups)
// ignore unparsed
.filter(Boolean)
// convert to seconds
@another-guy
another-guy / diy-vocabulary.md
Created October 7, 2019 20:19
DIY Vocabulary

divot — лунка, пробой

Keybase proof

I hereby claim:

  • I am another-guy on github.
  • I am anotherguy (https://keybase.io/anotherguy) on keybase.
  • I have a public key whose fingerprint is BA83 F183 5AD6 EB4E 8CBB FFB9 6156 FBC1 FEC5 5898

To claim this, I am signing this object:

@another-guy
another-guy / yoga-options.md
Last active May 16, 2019 20:09
Yoga Options Around Auburn WA

Yoga Options

Name What's there Address
Get Hot Yoga Warm Vinyasa. Hot Hatha. 27203 216th Ave SE Suite 7 :: Maple Valley, WA 98038
Elev8 Vinyasa. Hatha. Pilates. 2000 314th Street :: Federal Way, Washington 98003
evolve Vinyasa Flow 223 1st Ave S :: Kent, WA 98032
lonevita Ashtanga ...? 201 Auburn Way N Suite A :: Auburn, WA, 98002
corestar pilates ??? 205 East Main Street :: Suite B Auburn, WA 98002
@another-guy
another-guy / .bash_profile
Last active August 19, 2019 18:48
My Bash Profile
alias cs="less ~/.cheat-sheet.txt"
alias gbl="git blame "
alias gch="git checkout "
alias gchb="git checkout -b "
alias gcl="git clone "
alias gcm="git commit "
alias gcma="git commit --amend "
alias gcp="git cherry-pick "
alias gdd="git add "
alias gdf="git diff "