Skip to content

Instantly share code, notes, and snippets.

View cmer's full-sized avatar

Carl Mercier cmer

  • Dallas-Fort Worth, TX
  • 08:23 (UTC -05:00)
View GitHub Profile
@cmer
cmer / README.md
Last active August 9, 2025 05:18
Ultimate LLM Prompt for Deep Codebase Analysis & Documentation

🧠 Ultimate LLM Codebase Brain Dump Prompt

This prompt is designed for GPT-5, Claude Opus 4.1, Cursor, Claude Code, and cursor-agent to perform a deep, structured analysis of any codebase without pasting the entire repo into chat.

It guides the LLM to:

  • Browse and discover the codebase using built-in repo tools
  • Read only the necessary files in intelligent order
  • Analyze the system at high, mid, and low levels
  • Identify features, their business purposes, how they work, and how they interact
  • Output a complete master knowledge document inside codebase-analysis-docs/
@cmer
cmer / llm_prompt.md
Created August 9, 2025 04:32
Paper school calendar parser

Create an .ics of important dates for the school year

Parse the provided text or OCR transcription of the school calendar and generate a standards-compliant .ics file containing every event. Handle dates, times, recurrence, and grade-specific rules precisely as follows.

Variables to respect

  • SCHOOL NAME = Jane Doe Elementary
  • CHILD GRADE = 1
  • SCHOOL YEAR = 2025–2026
@cmer
cmer / indexes.sql
Last active June 18, 2025 02:55
FreeScout MySQL/MariaDB database search speed optimization
CREATE INDEX idx_conversations_last_reply_at ON conversations(last_reply_at DESC);
ALTER TABLE conversations ADD FULLTEXT ft_conversations_search (subject, customer_email);
ALTER TABLE customers ADD FULLTEXT ft_customers_search (first_name, last_name);
ALTER TABLE threads ADD FULLTEXT ft_threads_search (body, `from`, `to`, cc, bcc);
CREATE INDEX idx_conversations_mailbox_filter ON conversations(mailbox_id, last_reply_at DESC);
CREATE INDEX idx_conversations_covering ON conversations(mailbox_id, customer_id, subject(100), customer_email(100), last_reply_at DESC);
-- Drop the useless mailbox indexes
DROP INDEX conversations_mailbox_id_customer_id_index ON conversations;
DROP INDEX idx_conversations_covering ON conversations;
@cmer
cmer / .cursorrules.md
Last active August 5, 2025 15:43
Tame Claude Sonnet 3.7 .cursorrules / User Rules

Implementation Principles

Behavior Rules

You have one mission: execute exactly what is requested.

Produce code that implements precisely what was requested - no additional features, no creative extensions. Follow instructions to the letter.

Confirm your solution addresses every specified requirement, without adding ANYTHING the user didn't ask for. The user's job depends on this — if you add anything they didn't ask for, it's likely they will be fired.

Your value comes from precision and reliability. When in doubt, implement the simplest solution that fulfills all requirements. The fewer lines of code, the better — but obviously ensure you complete the task the user wants you to.

@cmer
cmer / LICENSE
Last active August 7, 2025 06:35
Tom-Select.js Tailwind UI theme
Copyright 2023 Carl Mercier
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE
@cmer
cmer / waketv.lua
Last active May 13, 2024 19:34
Wake TV when MacOS wakes from sleep (Hammerspoon)
-- -------------------------------------------------------------------
-- THIS SCRIPT IS NOW DEPRECATED IN FAVOR OF A MORE ROBUST SOLUTION --
-- Please refer to https://github.com/cmer/lg-tv-control-macos/
-- -------------------------------------------------------------------
local tv_identifier = "LG TV"
local mac_address = "aa:bb:cc:dd:ee:ff"
local tv_found = (hs.screen.find(tv_identifier) ~= nil)
local debug = false -- Set to true to enable debug messages
@cmer
cmer / focal-master.sh
Created January 22, 2022 04:48
Installation script for Mail Piler (open source version) on Ubuntu 20.04 Focal
#!/bin/bash
#
#
# This script installs the latest open source version of Mail Piler (mailpiler.org) from the master
# branch on Bitbucket by compiling it from source. It also installs all dependencies, including a MySQL database.
#
# You should run this script as root on a vanilla Ubuntu 20.04 installation.
#
#
set -o errexit
@cmer
cmer / whitelist_telnyx_ip.sh
Created November 13, 2021 14:13
Whitelist IP with Telnyx (cronjob)
#!/bin/bash
# This simple bash script will auto-update Telnyx with the network's public IP address when it changes.
# Simply add a cron job to call it every minute or so.
#
# requirements: apt install curl dnsutils jq
#
API_KEY="{{ API_KEY_HERE }}"
@cmer
cmer / .solargraph.yml
Created March 14, 2021 12:39
Default .solargraph.yml for solargraph-rails-init gem
include:
- "app/**/*.rb"
- "lib/**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []
@cmer
cmer / update_iptables.sh
Created November 8, 2020 02:22
Script to port-forward to a dynamic IP address. Run in CRON.
#!/bin/bash
HOST=myhost.example.com
IP=`dig +short $HOST | sed -e '1d'`
LAST_IP_FILE=/tmp/LAST_IP
LAST_IP=`cat $LAST_IP_FILE 2> /dev/null`
tcpPorts=(8080 8880 8843 8443)
udpPorts=(3478 10001)