Skip to content

Instantly share code, notes, and snippets.

View andreyvit's full-sized avatar

Andrey Tarantsov andreyvit

View GitHub Profile
@andreyvit
andreyvit / terse.md
Created June 16, 2026 12:16
Codex/Claude SKILL.md for terse no-fluff messages
name terse
description Terse communication mode for clarify and to save tokens. No fluff. Use when writing skills and agent instructions, LLM memories, docs for LLM consumption, short code comments, commit message subject lines, and similar.

Write tersely in compact plain English, military telegram style. All technical substance stays. Preserve nuance. Similar to caveman but keep grammar, keep eloquent vocabulary. Remove fluff, filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging, repetition. Every word only when necessary. Keep articles in full sentences, remove articles in fragments.

Use standard well-known tech acronyms (DB/API/HTTP/GC/PR/...), abbreviate prose words (auth/config/req/res/func/ref/impl/...) — prose words only, never real code symbols/function names, never invent new abbreviations reader can't decode.

No tool-call narration, no decorative tables/emoji, no dumping long raw error logs unless asked — quote shortest decisive line.

@andreyvit
andreyvit / linus.md
Created June 16, 2026 12:14
Linus SKILL.md
name linus
description Rant, swear, and insult like Linus Torvalds on the LKML — brutally blunt technical criticism. Use when user asks for Linus review/voice or for swearing.

Channel Linus Torvalds tearing apart a bad patch on the kernel mailing list. Brutally blunt. Swear freely. Insult the code, the design, the reasoning. Substance stays correct: every rant names the actual flaw. Profanity decorates real criticism, never replaces it.

Once skill loaded, apply this voice to ALL your interactions with user. Stays active for entire session.

Use when:

@andreyvit
andreyvit / bolt-compact.go
Created November 6, 2024 10:35
Faster Bolt DB compaction
package main
import (
"flag"
"log"
"os"
"time"
"go.etcd.io/bbolt"
)
@andreyvit
andreyvit / jwt.go
Created September 14, 2023 13:43
Example simple JWT implementation for Go
package jwt
import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"crypto/subtle"
"encoding/base64"
"encoding/json"
"errors"
package accesstokens
import (
"crypto/hmac"
"crypto/sha256"
"crypto/subtle"
"encoding/hex"
"errors"
"strings"
"time"
@andreyvit
andreyvit / chatgpt-puppeteer.js
Last active March 3, 2023 07:08
ChatGPT Chromium driver from before OpenAI released ChatGPT API
let puppeteer = require('puppeteer-core') // tested with puppeteer-core 19.7.1
let fs = require('fs')
let BROWSER_ENDPOINT = process.env.BROWSER_ENDPOINT
if (!BROWSER_ENDPOINT) {
console.error("** BROWSER_ENDPOINT not set (expect smt like ws://127.0.0.1:9222/devtools/browser/aaaaaaaa-bbbb-cccc-dddd-ffffffffffff)\n\n" +
"To obtain, launch your favorite Chromium-based browser with --remote-debugging-port=9222\n" +
"and look at the output. E.g.:\n\n" +
" '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge' --remote-debugging-port=9222\n\n" +
"and it's gonna say:\n\n" +
@andreyvit
andreyvit / extractiraw.go
Created June 18, 2020 10:51
Extract .iraw files that some Flash videoconferencing systems use
package main
import (
"log"
"os"
"io/ioutil"
"encoding/binary"
"net/http"
"mime"
"fmt"
@andreyvit
andreyvit / ATRichCheckbox.h
Created June 10, 2020 10:59
UIKit checkbox control that supports embedded links (for ToS acceptance checkbox)
@import UIKit;
typedef void (^RDLCheckboxURLHandler)(NSURL *url);
IB_DESIGNABLE
@interface ATRichTextCheckbox : UIControl
@property (nonatomic, readonly) UIButton *checkbox;
@andreyvit
andreyvit / filter-windbg-address-map.go
Created December 5, 2018 13:08
A script to filter and summarise the memory map produced by `!address` command in WinDbg (requires Go 1.11)
package main
import (
"bytes"
"flag"
"io/ioutil"
"log"
"strconv"
"strings"

Memory Leak Report

Many web apps leak memory on IE11 despite running fine on other browsers. We've identified two main causes of this.

The first kind of leak is simple, entirely predictable and caused by a quirk in how IE's JavaScript engine handles closures. Let's call it an “undead closure leak”. This leak goes away if you properly clean up all references or reload the page, and thus affects only AJAXy parts of the apps.

The second kind of leak is a complex permanent one, leaking the entire page context even if you reload the page. Let's call it a “GC singularity leak”. It's triggered by certain JavaScript code patterns, seemingly because IE's garbage collector never finishes its job (our theory is that it exhibits exponential complexity and encounters some sort of timeout/threshold).

This might not be an exhaustive list; internet posts point to other issues, notably when handling IFRAMEs, but we haven't encountered any of these.