Skip to content

Instantly share code, notes, and snippets.

View empjustine's full-sized avatar

大関 金城 秀喜 カシオ empjustine

View GitHub Profile
@altryne
altryne / instructions.md
Created May 14, 2026 23:28
Setting minimum age on package manager configs to prevent supply chain attacks

Minimum-Age Gates for Package Managers

Use this as a baseline across all Macs to reduce exposure to fast-moving supply-chain attacks, where a malicious package version is published, installed by early updaters, then removed hours later.

The default policy I would use is:

  • Personal/dev machines: 3 days.
  • CI and production lock refresh jobs: 3 to 7 days.
  • Emergency security fixes: bypass deliberately, one package at a time, with a reviewed lockfile diff.

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

#!/usr/bin/env bash
set -euo pipefail
# patch-claude-code.sh — Rebalance Claude Code prompts to fix corner-cutting behavior
#
# What this does:
# Patches the npm-installed @anthropic-ai/claude-code cli.js to rebalance
# system prompt instructions that cause the model to cut corners, simplify
# excessively, and defer complicated work.
#

Write a handoff document summarising this session for future agents/sessions.

Steps

  1. Determine today's date (use the currentDate context if available).

  2. List the existing files under docs/agents/handoff/ to find the highest sequence number already used today, then increment by one. Format: NNN (zero-padded to 3 digits, starting at 001).

  3. Use the current session name, otherwise derive a short kebab-case topic slug from the main subject of this session (e.g. eth-brownie-optimization, filter-sol-wsol-command).

@ossa-ma
ossa-ma / tropes.md
Last active September 8, 2026 02:35
AI Writing Tropes to Avoid — tropes.fyi by ossama.is

AI Writing Tropes to Avoid

Add this file to your AI assistant's system prompt or context to help it avoid common AI writing patterns. Source: tropes.fyi by ossama.is


Word Choice

"Quietly" and Other Magic Adverbs

name: base
clearenv: true
dieWithParent: true
unsharePid: true
newSession: true
mounts:
/proc: proc
/dev: dev
/tmp: tmpfs
/etc: {bind: {path: /etc, readOnly: true}}
@clmrb
clmrb / enum.js
Last active February 3, 2026 21:37
JavaScript enum function with working JSDoc autocompletion
/**
* @description
* Creates a frozen enumeration object where each key maps to its own string value.
* This is useful for defining a set of constant string values that can be referenced by name.
* This also avoids defining an object with duplicated string values manually.
* @template {string} T
* @param {...T} values
* @returns {{ [K in T]: K }}
* @example
* const Colors = Enum('Red', 'Green', 'Blue');
@ctrlcmdshft
ctrlcmdshft / Import_export_fields.md
Created October 24, 2025 17:22
Bitwarden export import fields

Below is a comprehensive list of all fields that can be included in the Bitwarden JSON format for import and export, based on the Bitwarden CLI documentation and the JSON import format specified at https://bitwarden.com/help/import-data/#bitwarden-import-format. These fields apply to both personal and organization vault exports/imports, with notes on where they are specific to one or the other. The list covers the root object, folders, collections, and items (including type-specific sub-objects).

Root-Level Fields

  • encrypted: Boolean (optional; e.g., false for unencrypted, typically present in organization exports).
  • folders: Array of folder objects (personal vaults; empty [] or omitted for organization vaults).
  • collections: Array of collection objects (organization vaults; empty [] or omitted for personal vaults).
  • items: Array of item objects (required; core vault data).

Folder Object Fields (in folders array)

  • id: String (UUID, required for referencing in items).

busctl --user --full introspect org.freedesktop.secrets /org/freedesktop/secrets

NAME                                TYPE      SIGNATURE RESULT/VALUE                                      FLAGS
org.freedesktop.DBus.Introspectable interface -         -                                                 -
.Introspect                         method    -         s                                                 -
org.freedesktop.DBus.Peer           interface -         -                                                 -
.GetMachineId                       method    -         s                                                 -
.Ping                               method    -         -                                                 -
org.freedesktop.DBus.Properties     interface -         -                                                 -
@vanschelven
vanschelven / tabdouse.py
Created May 21, 2025 11:44
CPU on Fire? Douse the Tab
import subprocess
from time import sleep
from datetime import datetime
COL_PID = 0
COL_CPU = 8
COL_NAME = 11
FF_CPU_THRESHOLD = 50
TIME_THRESHOLD = 10