Skip to content

Instantly share code, notes, and snippets.

View kroleg's full-sized avatar
⌨️
Mechanical keyboi

Vitaliy Zaytsev kroleg

⌨️
Mechanical keyboi
View GitHub Profile
@kroleg
kroleg / howto.txt
Created January 31, 2026 16:27
tailscale on keentic
https://forum.keenetic.ru/topic/11085-tailscale-–-сеть-vpn-которая-не-нуждается-в-конфигурировании/page/2/
сделал инструкцию, еще обкатываю ее, но хотябы tailscale не отключает соединения извне каждые N минут
для тех у кого tailscale вместо headscale пропустите часть с подключением к headscale
Установка компонентов
Hide contents
Установка компонентов
@kroleg
kroleg / architecture.md
Last active January 12, 2026 10:25
Typescript service

TypeScript Service Architecture Guidelines

Instructions for Claude to replicate the homelab TypeScript architecture in new projects.

Quick Start Template

npm:

mkdir my-service && cd my-service
npm init -y
@kroleg
kroleg / index.html
Last active January 10, 2026 14:37
qs DoS test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>qs arrayLimit Test</title>
<style>
body { font-family: monospace; padding: 20px; max-width: 1400px; margin: 0 auto; }
.section { margin-bottom: 30px; }
.section h2 { background: #333; color: white; padding: 10px 15px; margin: 0 0 15px 0; border-radius: 8px 8px 0 0; }
.container { display: flex; gap: 15px; flex-wrap: wrap; }
@kroleg
kroleg / how-to-claude.md
Last active January 5, 2026 08:26
Writing a good CLAUDE.md

Writing a good CLAUDE.md

Principle: LLMs are (mostly) stateless

LLMs are stateless functions. Their weights are frozen by the time they're used for inference, so they don't learn over time. The only thing that the model knows about your codebase is the tokens you put into it.

Similarly, coding agent harnesses such as Claude Code usually require you to manage agents' memory explicitly. CLAUDE.md (or AGENTS.md) is the only file that by default goes into every single conversation you have with the agent.

This has three important implications:

Coding agents know absolutely nothing about your codebase at the beginning of each session.

@kroleg
kroleg / review guidelines
Last active December 24, 2025 13:55
review guidelines
You wrote this code [paste code]. Now pretend you're a senior dev
doing a code review and you HATE this implementation. What would
you criticize? What are the edge cases I'm not seeing?
Once done remove all files
@kroleg
kroleg / migration.md
Last active December 24, 2025 17:14
nod24 typestripping

Migrating to Node.js v24 Native Type Stripping

Instructions for converting TypeScript projects from tsc compilation to Node.js v24 native type stripping.

Overview

Node.js v24 can run .ts files directly by stripping types at runtime (no compilation needed). This simplifies the build process and reduces dependencies.

Prerequisites

@kroleg
kroleg / .dockerignore
Last active October 30, 2018 16:00
Gitlab ci tests
node_modules
server/dist
public
.idea
.settings
.project
*.log
@kroleg
kroleg / object.pick.js
Created October 13, 2016 11:38
Returns a filtered copy of an object with only the specified keys, similar to _.pick from lodash / underscore.
'use strict';
// source: https://github.com/jonschlinkert/object.pick
function isObject(val) {
return val !== null && typeof val === 'object' && Array.isArray(val) === false;
}
module.exports = function pick(obj, keys) {
if (!isObject(obj) && typeof obj !== 'function') {
@kroleg
kroleg / format.js
Created November 24, 2014 12:40
Format money
money.toFixed().replace(/\d(?=(\d{3})+$)/g, '$& ');