Skip to content

Instantly share code, notes, and snippets.

View skatkov's full-sized avatar
🏠

Stanislav (Stas) Katkov skatkov

🏠
View GitHub Profile
{"session_id":"GitHits-899010","server_label":"GitHits","seq":1,"ts":"2026-07-15T13:36:50.229550739+02:00","direction":"meta","transport":"stdio","raw":{"command":["npx","-y","githits@latest","mcp","start"],"cwd":"/home/sk"}}
{"session_id":"GitHits-899010","server_label":"GitHits","seq":2,"ts":"2026-07-15T13:36:50.245458273+02:00","direction":"c2s","transport":"stdio","raw":{"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{"roots":{}},"clientInfo":{"name":"opencode","version":"1.18.1"}},"jsonrpc":"2.0","id":0}}
{"session_id":"GitHits-899010","server_label":"GitHits","seq":3,"ts":"2026-07-15T13:36:51.316323336+02:00","direction":"s2c","transport":"stdio","raw":{"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{"listChanged":true}},"serverInfo":{"name":"githits","version":"0.6.2"},"instructions":"GitHits provides verified open-source examples plus indexed package/repository evidence.\n\nRouting: use `get_example` for canonical cross-project examples; use `search` /
@skatkov
skatkov / json
Created May 17, 2026 23:53
5000 top downloads from rubygems
[
{
"name": "bundler",
"downloads": 6785603219
},
{
"name": "aws-sdk-core",
"downloads": 3327372761
},
{
# config/initializers/rollout.rb
ROLLOUT_OPTIONS = YAML.load_file(Rails.root.join(“config”, “rollout.yml”))[Rails.env]
#!/bin/sh
set -eu
#region logging setup
if [ "${MISE_DEBUG-}" = "true" ] || [ "${MISE_DEBUG-}" = "1" ]; then
debug() {
echo "$@" >&2
}
else
debug() {
@skatkov
skatkov / fix-extlz4.sh
Created May 25, 2025 14:40
Fix exltz4 gem installation
#!/bin/bash
set -e
echo "Simple comprehensive fix for extlz4 gem installation..."
# Create temporary directory
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
echo "Downloading extlz4 gem..."
@skatkov
skatkov / method_call_detection.rb
Created May 20, 2025 09:53
Method detection code
# Raises an error when method is called, unless it was called by known caller.
#
# In your class:
#
# include MethodCallDetection
# detect_method_calls_of :method_to_detect do |trace|
# next true if trace[0].match?('path/of/direct_call.rb:123')
# next true if trace.any? { _1.match?('path/of/call_somewhere.rb') }
# end
module MethodCallDetection
@skatkov
skatkov / settings.json
Last active April 20, 2025 17:05
zed.settings.json
{
"ui_font_family": "FiraCode Nerd Font Mono",
"buffer_font_family": "FiraCode Nerd Font Mono",
"theme": {
"mode": "system",
"light": "Alabaster",
"dark": "One Dark"
},
"lsp": {
"golangci-lint": {
@skatkov
skatkov / choosy
Last active June 7, 2025 21:47 — forked from cesarolea/choosy
Open browser based off of certain rules (like choosy for macOS)
#!/bin/bash
URL=$1
DOMAIN=$(echo "$URL" | awk -F[/:] '{print $4}')
# Read the list of domains from the file
DOMAIN_LIST=$(cat /home/sk/.config/url-list.txt)
# Check if the domain is in the list
if echo "$DOMAIN_LIST" | grep -q "$DOMAIN"; then
@skatkov
skatkov / pull_request_template.md
Created September 14, 2024 21:15
Pull Requst Template

What

Replace this with a description of the changes that you are making. To help reviewers easily understand the changes, please add before/after screenshots or a short demo video recording of the feature/bugfix here.

Why

Replace this with a reason for the changes you are making.

Checklist

@skatkov
skatkov / create_pr.sh
Last active September 14, 2024 21:17 — forked from slavingia/create_pr.sh
Create a (draft) pull request using GitHub CLI
#!/bin/bash
# Create a (draft) pull request using GitHub CLI.
# It assigns the PR to the current user, fills in the title from the first commit,
# and uses the PR template file for the description.
set -euo pipefail
# Colors for output
RED='\033[0;31m'