Skip to content

Instantly share code, notes, and snippets.

View khasky's full-sized avatar
💭
Находи в себе силы делать то, на что другие просто не способны.

Khasky khasky

💭
Находи в себе силы делать то, на что другие просто не способны.
View GitHub Profile
@khasky
khasky / settings.json
Last active August 30, 2026 10:00
Permissive .claude/settings.json
{
"attribution": {
"commit": "",
"pr": ""
},
"permissions": {
"allow": [
"Bash",
"Bash(gh api:*)",
"Bash(git push:*)",
@khasky
khasky / github-contributors-cache-fix.md
Created August 22, 2026 07:49
Removing a stale contributor from a GitHub repository (the contributors cache survives a history rewrite)

Removing a stale contributor from a GitHub repository

You rewrote history to drop commits authored by the wrong account, force-pushed, and the sidebar on the repository page still lists that account under Contributors. Waiting does not help — reports of it persisting for days are common.

Why it happens

The contributors list is a cached index, not a live read of the commit graph. A force-push replaces the refs but never invalidates that index. The REST endpoints and the rendered

@khasky
khasky / clear-git-commit-history.txt
Created July 30, 2026 05:13
Clear git commit history
0. Бэкап (обязательно перед переписыванием истории):
git clone --mirror https://github.com/khasky/repo.git ../repo-backup.git
1. Схлопнуть всё в один коммит (orphan-метод):
git checkout --orphan fresh
git add -A
git commit -m "Initial commit"
git branch -D main
git branch -m fresh main
@khasky
khasky / windows-dev-cache-cleanup.bat
Last active July 10, 2026 23:32
Safely clean common Windows development caches: pip, npm, Yarn, pnpm, Playwright, and inspect installed NVM versions.
:: 1) pip
py -m pip cache info
py -m pip cache purge
:: 2) npm
npm cache verify
npm cache clean --force
:: 3) yarn
yarn cache clean
@khasky
khasky / settings.local.json
Created May 16, 2026 07:13
Claude Code settings preset: acceptEdits mode with full Bash allowed, plus ask/deny guardrails for dangerous, network, Git, publish, and secrets-related actions
{
"permissions": {
"defaultMode": "acceptEdits",
"allow": [
"Read",
"Edit",
"Write",
"Bash"
],
"ask": [
@khasky
khasky / settings.local.json
Created May 16, 2026 07:12
Claude Code settings preset: acceptEdits mode, explicit dev-command allowlist, MCP whitelist, and guardrails for secrets and destructive Bash commands
{
"permissions": {
"defaultMode": "acceptEdits",
"allow": [
"Read",
"Edit",
"Write",
"Bash(git status)",
"Bash(git status *)",
@khasky
khasky / .cursorindexingignore
Created May 8, 2026 05:21
.cursorindexingignore
node_modules/
dist/
build/
coverage/
.next/
.nuxt/
.turbo/
.cache/
@khasky
khasky / .cursorignore
Created May 8, 2026 05:20
.cursorignore
# Secrets
.env
.env.*
*.pem
*.key
*.p12
*.pfx
secrets/
private/
certs/
@khasky
khasky / settings.json
Created May 8, 2026 05:15
%USERPROFILE%\.claude\settings.json
{
"env": {
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"DISABLE_TELEMETRY": "1",
"DISABLE_ERROR_REPORTING": "1",
"DISABLE_FEEDBACK_COMMAND": "1",
"CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY": "1",
"CLAUDE_CODE_SKIP_PROMPT_HISTORY": "1",
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": "1",
@khasky
khasky / useScrollDirection.ts
Created April 8, 2026 06:41
useScrollDirection React Hook
// Subscribes to `scroll` (passive) and exposes whether the user is moving
// down the page, up, or still in the “top” band (y === 0 or within ~40px while settling).
import { useEffect, useState } from 'react';
export enum ScrollDirection {
Top = -1,
Initial = 0,
Bottom = 1,
}