Skip to content

Instantly share code, notes, and snippets.

View coreyward's full-sized avatar

Corey Ward coreyward

View GitHub Profile
Replicate Codex Micro Layer 1 on Layer 2
This guide is written so it can be given directly to an agent. Its goal is to make Layer 2 behave exactly like the protected Codex Layer 1. Afterward, Layer 2 remains editable in Work Louder Input, so individual keys can be replaced normally.
This is an unsupported, version-sensitive technique. Back up the configuration and follow the validation steps before writing anything to the device.
## Expected result
Layer 2 retains its own name, color, and lighting settings, but gains Layer 1's:
@corporatepiyush
corporatepiyush / db_compare.md
Last active August 24, 2026 03:45
Database Comparison — SQLite · DuckDB · PostgreSQL · MariaDB · ClickHouse · MongoDB

Database Comparison — SQLite · DuckDB · PostgreSQL · MariaDB · ClickHouse · MongoDB

Version claims cross-checked against official release channels on 2026-07-15. Feature statements describe the versions listed in the table below. Where a database lacks a capability, or has it only in part, the closest practical alternative is given as Alternative:.

Database Stable Version Released Support Storage / Execution Model
SQLite 3.53.3 Jun 26, 2026 Format/API support pledged through 2050 Row-oriented B-trees, in-process, single file
@kieranklaassen
kieranklaassen / token_analysis.py
Created April 6, 2026 20:24
Claude Code token usage analyzer - breaks down usage by project, session, and subagent
#!/usr/bin/env python3
"""
Claude Code token usage analyzer.
Analyzes ~/.claude/projects/ JSONL files for token usage patterns.
"""
import json
import os
import sys
from pathlib import Path
@antirez
antirez / codex_skill.md
Last active August 23, 2026 08:18
CLAUDE_CODEX_SKILL.md
name codex
description Use OpenAI Codex CLI for complex debugging, code analysis, or when stuck on difficult problems. Invokes Codex with a file-based question/answer pattern.
disable-model-invocation true

Using Codex for Complex Debugging

When you encounter a difficult problem that would benefit from a second perspective or deep analysis, use Codex via the file-based pattern.

@coreyward
coreyward / git-editor.sh
Created April 11, 2025 19:04
Dynamically configure your git editor based on the IDE you invoke it from
#!/bin/zsh
# Instructions:
# 1. Put this file in your user folder (~/git-editor)
# 2. Enable execution by running `chmod +x ~/git-editor`
# 3. Run `git config --global core.editor "~/git-editor"
# 4. Now when you run a git command that launches your interactive editor, it'll use the current IDE
# Function to get the process name by PID
get_process_name() {
@donaldguy
donaldguy / userscript-app_hey_com-unread_and_autoadvance.js
Last active September 12, 2024 03:47
app.hey.com: add unread counts and auto-advance to the "Imbox" - very much a work in progress
// ==UserScript==
// @name Add counts to Hey.com Imbox (and contents)
// @run-at document-end
// @match https://app.hey.com/*
// @grant GM_getValue
// @grant GM_setValue
const BASE_URL_PATTERN = 'https://app\\.hey\\.com'
let UnreadCount = -1;
@coreyward
coreyward / injectFnComments.js
Created January 20, 2023 21:38
Inject JSDoc comments into generated TypeScript Type definition files
/**
* This script injects JSDoc comments from the JS source files into the type
* definition files. This is necessary because the type definition files
* generated by TypeScript do not include JSDoc comments.
*
* @see https://github.com/microsoft/TypeScript/issues/14619
*
* The strategy is a bit hacky, but straightforward:
*
* 1. Recursively walk the output folder looking for .d.ts files
@rexxars
rexxars / bundleChecker.js
Last active March 16, 2021 21:06
Sanity studio bundle update checker
import {useEffect} from 'react'
import config from 'config:sanity'
const BUNDLE_CHECK_INTERVAL = 15 * 1000
async function getCurrentHash() {
const basePath = (config.project && config.project.basePath) || '/'
const html = await fetch(basePath).then((res) => res.text())
const [, hash] = html.match(/app\.bundle\.js\?(\w+)/) || []
return hash
@kmelve
kmelve / department.js
Created April 15, 2020 07:35
Example of listing documents in Sanity Studio‘s desk structure with real-time listener
export default {
name: 'department',
type: 'document',
title: 'Department',
fields: [
{
name: 'title',
type: 'string',
title: 'Title',
},
@coreyward
coreyward / README.md
Last active November 7, 2021 09:39
I wrote this hook to persist a simple user settings (think dark mode) to local storage in a cross-tab compatible way.

useStorage React Hook

Similar to useState but with some lightweight behind-the-scenes writing to localStorage; also subscribes to changes in localStorage to allow for cross-tab changes to sync automatically.

Example Usage

The first argument is the name of the local storage property/key you want to control with this hook. The second argument, options, really just has one available directive: bool. Setting bool to true has the effect of evaluating the data