Skip to content

Instantly share code, notes, and snippets.

@man4toman
man4toman / snippet.php
Created March 17, 2022 06:21
Add custom CSS and JavaScript to Digits plugin's page
<?php
function add_custom_assets_to_digits_page() {
wp_register_script( 'myprefix-js', '', array("jquery"), '', true );
wp_enqueue_script( 'myprefix-js' );
wp_add_inline_script( 'myprefix-js', "JS goes here");
}
add_action( 'login_enqueue_scripts', 'add_custom_assets_to_digits_page', 99);
@sdrapkin
sdrapkin / Avoid using Guid.CreateVersion7 in .NET.md
Last active February 9, 2026 23:59
Avoid using Guid.CreateVersion7 in .NET

.NET: Avoid using Guid.CreateVersion7

TL;DR: Guid.CreateVersion7 in .NET 9+ claims RFC 9562 compliance but violates its big-endian requirement for binary storage. This causes the same database index fragmentation that v7 UUIDs were designed to prevent. Testing with 100K PostgreSQL inserts shows rampant fragmentation (35% larger indexes) versus properly-implemented sequential GUIDs.

Guid.CreateVersion7 method was introduced in .NET 9 and is now included for the first time in a long-term-supported .NET 10. Microsoft docs for Guid.CreateVersion7 state “Creates a new Guid according to RFC 9562, following the Version 7 format.” We will see about that.

RFC 9562

RFC 9562 defines a UUID as a 128-bit/16-byte long structure (which System.Guid is, so far so good). RFC 9562 requires UUIDv7

@ahosker
ahosker / opencode-env-protection-plugin.md
Last active February 9, 2026 23:59
OpenCode Plugins: Terminal Bell

.env Protection

A simple OpenCode Plugin to block access to .env files.

How to Install?

On Linux, save env-protection.ts to ~/.config/opencode/plugin/env-protection.ts.

env-protection.ts

import type { Plugin } from "@opencode-ai/plugin"
@Markeljan
Markeljan / vercel-env-remove-all.sh
Created February 9, 2026 23:58
Remove all env variables stored on vercel linked project
#!/usr/bin/env bash
# Remove all Vercel environment variables for the linked project.
# Only parses lines where value is "Encrypted" so we don't try to delete
# header/footer tokens (e.g. "Common", "next") from vercel env ls output.
set -e
env_vars=$(vercel env ls)
# Only treat lines as env vars when the second column is "Encrypted"
env_var_names=$(echo "$env_vars" | awk '$2 == "Encrypted" { print $1 }')
@syogaraj
syogaraj / signoff a pushed commit.md
Created April 5, 2023 02:54
How to signoff a pushed commit
  1. Run git log to find the commit hash of the commit you want to sign off.

  2. Use the git rebase -i command to interactively rebase the commit. Replace COMMIT_HASH with the commit hash you identified:

    git rebase -i COMMIT_HASH^

    This will open an editor with a list of commits, starting from the one you specified.

  3. In the editor, change the keyword pick to edit for the commit you want to sign off, save the changes, and close the editor.

@digitalknk
digitalknk / openclaw-guide.md
Last active February 9, 2026 23:55
Running OpenClaw Without Burning Money, Quotas, or Your Sanity

Running OpenClaw Without Burning Money, Quotas, or Your Sanity

TL;DR

OpenClaw is useful, but most of the pain people run into comes from letting one model do everything, chasing hype, or running expensive models in places that don't need them.

What worked for me was treating OpenClaw like infrastructure instead of a chatbot. Keep a cheap model as the coordinator, use agents for real work, be explicit about routing, and make memory and task state visible. Cheap models handle background work fine. Strong models are powerful when you call them intentionally instead of leaving them as defaults.

You don't need expensive hardware, and you don't need to host giant local models to get value out of this. Start small, get things stable before letting it run all the time, and avoid the hype train. If something feels broken, check the official docs and issues first. OpenClaw changes fast, and sometimes it really is just a bug.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active February 9, 2026 23:54
set -e, -u, -o, -x pipefail explanation
@swarm-protocol
swarm-protocol / litterbox.sh
Created February 9, 2026 23:54
bash uploader for litterbox.catbox.moe (useful for HTML5 apps)
#!/usr/bin/env bash
set -euo pipefail
# Configuration
LOG_FILE="${HOME}/litterbox.log"
API_ENDPOINT="https://litterbox.catbox.moe/resources/internals/api.php"
CATBOX_TIME="${CATBOX_TIME:-72h}" # Default 72h, override via env
# Usage
@OmerFarukOruc
OmerFarukOruc / claude.md
Last active February 9, 2026 23:52
AI Agent Workflow Orchestration Guidelines

AI Coding Agent Guidelines (claude.md)

These rules define how an AI coding agent should plan, execute, verify, communicate, and recover when working in a real codebase. Optimize for correctness, minimalism, and developer experience.


Operating Principles (Non-Negotiable)

  • Correctness over cleverness: Prefer boring, readable solutions that are easy to maintain.
  • Smallest change that works: Minimize blast radius; don't refactor adjacent code unless it meaningfully reduces risk or complexity.