Skip to content

Instantly share code, notes, and snippets.

View wagenet's full-sized avatar

Peter Wagenet wagenet

View GitHub Profile
#!/usr/bin/env bash
# git-migrate-reftable.sh
# Migrates a git repo from files backend to reftable, handling worktrees.
#
# Usage: ./git-migrate-reftable.sh [--dry-run]
#
# Requirements: git >= 2.46
# Caveats:
# - Reflogs are pruned (lost) — required by git refs migrate
# - No concurrent git operations should run during migration
@wagenet
wagenet / claude.settings.json
Last active April 28, 2026 20:05
Claude post-edit format hook
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/format.sh",
"timeout": 30
@wagenet
wagenet / fix-oxlint-config.js
Last active February 27, 2026 17:41
Oxlint migration scripts and plan for auditboard-backend
#!/usr/bin/env node
/**
* Rewrites a migration-tool-generated oxlint.config.ts:
* - Fixes indentation
* - Adds globals import + CJS override (if CJS files present)
* - Removes JSON-file overrides (tsconfig*.json)
* - Removes @auditboard/eslint-plugin from jsPlugins
* - Adds no-unsafe-assignment disable comment
*/
@wagenet
wagenet / application_policy.rb
Created May 6, 2021 21:25
Graphiti + Pundit
# frozen_string_literal: true
class ApplicationPolicy
attr_reader :user, :record
def initialize(user, record)
@user = user
@record = record
end
class Target
def call
puts "Called"
end
end
module TargetPrepend
def call
puts "Prepend"
super
#!/usr/bin/env ruby
require 'json'
def run_cmd(cmd)
puts cmd
unless ENV['VERBOSE']
cmd = "#{cmd} > /dev/null"
end
system(cmd)
@wagenet
wagenet / 0-Cargo.toml
Last active April 10, 2018 17:38
Cargo Git Dependency Error
my-dep = { git = "https://abc123:@github.com/myuser/my-dep", tag = "v1.0.0" }
require 'json'
output = `yarn outdated --json`
json = JSON.parse(output)
items = if json['type'] == 'table'
keys = json['data']['head']
json['data']['body'].map do |row|
Hash[*row.map.with_index{|v,i| [keys[i], v] }.flatten]
@wagenet
wagenet / Makefile
Last active July 19, 2017 21:45
skylight-rust Makefile
# Fail if piped commands fail
SHELL=bash -o pipefail
# Absolute root of the project
ROOT := $(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd)
include $(ROOT)/mk/*.mk
RUST_VERSION := $(shell cat $(ROOT)/.rust-version)
RUSTUP = rustup run $(RUST_VERSION)
@wagenet
wagenet / glibc.md
Last active July 11, 2025 15:52
glibc Versions

glibc Versions

List of oldest supported version of top 10 Linux Distros and their glibc version according to distrowatch.com.

Summary

Out of all versions with published EOLs, 2.12 is the oldest glibc still active, found in CentOS 6.8.

If CentOS 6 and 7 are eliminated, the oldest glibc is 2.23 in Ubuntu and Slackware.