Skip to content

Instantly share code, notes, and snippets.

View turlockmike's full-sized avatar

Mike D turlockmike

View GitHub Profile
@turlockmike
turlockmike / README.md
Created March 6, 2026 17:07
Claude Code Usage Monitor — query rate limit status from the terminal (NDJSON output)

Claude Code Usage Monitor

Query your Claude Code rate limit status from the terminal. Returns NDJSON with utilization percentages and reset countdowns for each rate window.

Prerequisites

  • Claude Code installed and authenticated (claude auth)
  • macOS (reads OAuth token from Keychain via security CLI)
  • python3 and curl on PATH
@turlockmike
turlockmike / sandbox-setup.sh
Created January 14, 2026 21:03
EC Sandbox setup script
#!/bin/bash
set -e
# EC Sandbox Setup Script
# Downloaded at runtime by tiny UserData bootstrap
#
# Usage:
# ./sandbox-setup.sh [options]
#
# Options:
@turlockmike
turlockmike / migration-plan-gist.md
Last active June 20, 2025 20:41
Extend CLI Agent Migration Plan - Executive Summary

Extend CLI Agent Migration Plan - Detailed Command Mapping

🎯 Goal

Migrate all Extend CLI commands to agent-based interfaces. Complete command-by-command breakdown below.

📊 Coverage Summary

  • Original Commands: ~95 total
  • Removed/Deprecated: 31 commands
  • Migrating to Agents: 64 commands
  • Agent Coverage: 100%
@turlockmike
turlockmike / 01_starting_phase_prompt.md
Last active May 7, 2025 17:39
Development Workflow Prompts (6 Phases + Master)

Starting Phase: Setup and Task Acquisition

Goal: To prepare your development environment, retrieve all necessary task details, and create a dedicated feature branch, ensuring you are ready to begin the Researching Phase.

Phase Starts: When a new Jira ticket is assigned, a new task is identified, or when a user suggests a large feature to build. Phase Ends: When you have a clean, up-to-date feature branch with all necessary ticket information loaded, and the ticket (if applicable) is moved to "In Progress" and assigned to you.

Expected Artifacts:

  • Local repository on the correct feature branch.
  • Feature branch correctly named and ideally pushed to the remote repository.
# EC Command Reference
Version: @extend/extend-cli/1.0.5
## Core Commands
```
ec help
- Display help for ec commands and topics
ec update [version]
- Update the CLI to the latest version
@turlockmike
turlockmike / contract-created.ts
Last active September 12, 2023 19:11
Event Handlers
//filepath: src/handlers/messages/contract-created.ts
import {vaidationMiddleware} from '@helloextend/api-utils'
//Handle a single Cloud Event.
function contractCreatedHandler(ev: CloudEvent, ctx: Context) {
const messageBody = JSON.parse(ev.message.body) //Or something. Whatever the cloudEvent specification says
const isRetry = ctx.get<number>('event.metadata.retries') > 0
function addMonths(date: Date, months: number): Date {
const newDate = new Date(date)
const dayOfMonth = newDate.getDate()
// The JS Date object supports date math by accepting out-of-bounds values for
// month, day, etc. For example, new Date(2020, 1, 0) returns 31 Dec 2019 and
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
// want except that dates will wrap around the end of a month, meaning that
// new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
// we'll default to the end of the desired month by adding 1 to the desired
8:20:41 PM: Build ready to start
8:20:42 PM: build-image version: 84aca9ba39e0ee86ba194760fbfc51a808f62543
8:20:42 PM: buildbot version: 1ac64ca11e029436ed45ac81a38b9839778ec314
8:20:43 PM: Fetching cached dependencies
8:20:43 PM: Starting to download cache of 129.9MB
8:20:45 PM: Finished downloading cache in 2.548835358s
8:20:45 PM: Starting to extract cache
8:20:51 PM: Finished extracting cache in 5.456247149s
8:20:51 PM: Finished fetching cache in 8.116293732s
8:20:51 PM: Starting to prepare the repo for build
@turlockmike
turlockmike / forms.js
Last active November 17, 2017 22:58
Forms SDK Ideas
//Example in powerforms for example
var el = $("#form");
var data = RetrieveFormData();
forms = new FormSDK(el, data);
forms.Start().then(function(results) {
if (results.age > 50) {
var GAME_CONFIG = {debugMode: false}; //Put some stuff here
var GRAPHICS_CONFIG = {width: 680, height: 400};
var GAME_DATA_FOLDER = "/game_data";
function main() {
//Initialize Components
Game game = new Game(GAME_CONFIG);
GraphicsEngine engine = new SDLGraphicsEngine(GRAPHICS_CONFIG);
GameData assets = new GameData(GAME_DATA_FOLDER);