Skip to content

Instantly share code, notes, and snippets.

@a-c-m
a-c-m / gist:3cb6c2cb1a9e977aec9723a35c7278ee
Created July 9, 2026 08:14
Auto join google meetings
// ==UserScript==
// @name Google Meet Auto-Join & Auto-Close
// @namespace http://tampermonkey.net/
// @version 1.2
// @description Auto-clicks the join button on Google Meet, and closes the tab 5 seconds after leaving a meeting.
// @author You
// @match https://meet.google.com/*
// @grant none
// @run-at document-idle
// ==/UserScript==
@a-c-m
a-c-m / fix-home-end-keys.sh
Last active April 13, 2026 10:49
Home/End remap for OSX (like it should be)
#!/bin/bash
# =============================================================================
# fix-home-end-keys.sh
#
# Fixes Home/End key behaviour on macOS so they jump to the start/end of the
# current line, rather than the top/bottom of the document (page up/down).
#
# macOS supports a system-wide key binding file that most native (Cocoa) apps
# respect. This script safely adds the required bindings to that file without
@a-c-m
a-c-m / fix-home-end-keys.sh
Created April 13, 2026 09:06
Home/End remap for OSX (like it should be)
#!/bin/bash
# =============================================================================
# fix-home-end-keys.sh
#
# Fixes Home/End key behaviour on macOS so they jump to the start/end of the
# current line, rather than the top/bottom of the document (page up/down).
#
# macOS supports a system-wide key binding file that most native (Cocoa) apps
# respect. This script safely adds the required bindings to that file without
@a-c-m
a-c-m / git-stats.sh
Created June 13, 2025 11:04
Git stats per dev (LOC) with delta and comparison
#!/bin/bash
# --- Config ---
EXCLUDE_EXTENSIONS="sql|log|csv|tsv|json|png|jpg|jpeg|gif|bmp|svg|mp4|mp3|zip|gz|tar|pdf|xlsx?|docx?"
WEEKS=4
COMPARE=false
# --- Args ---
for arg in "$@"; do
if [[ "$arg" == "--compare" ]]; then
COMPARE=true
@a-c-m
a-c-m / reflection.md
Last active June 24, 2026 04:04
reflection.md - a way to have claude-code self improve its context.

You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code. Follow these steps carefully:

  1. Analysis Phase: Review the chat history in your context window.

Then, examine the current Claude instructions, commands and config <claude_instructions> /CLAUDE.md /.claude/commands/*

@a-c-m
a-c-m / autocomplete.sql
Last active January 29, 2025 18:50
PG function to autocomplete fields
CREATE OR REPLACE FUNCTION dynamic_autocomplete(
table_name TEXT,
field_name TEXT,
search_input TEXT
) RETURNS TABLE(count INT, value TEXT)
LANGUAGE plpgsql AS
$$
DECLARE
query TEXT;
BEGIN
import { Box, TextField, Autocomplete } from '@mui/material';
interface CountryType {
code: string;
label: string;
search?: string;
}
interface CountrySelectProps {
value?: CountryType | null;
@a-c-m
a-c-m / measure-node_modules.sh
Created December 15, 2023 10:14
Measures the sizes of your root node_modules folders.
#!/bin/bash
# Find all top-level node_modules directories and calculate their total size
total_size=0
for dir in $(find . -name "node_modules" -type d -not -path "*/node_modules/*"); do
size=$(du -sk "$dir" | cut -f1)
total_size=$(($total_size + $size))
done
# Convert total size to human-readable format
@a-c-m
a-c-m / rm-node_modules.sh
Created December 13, 2023 17:50
A nicer rm all node modules
#!/bin/bash
# Define the directory from where to start searching for node_modules directories
START_DIR="."
# Find all node_modules directories and count them
NODE_MODULES_DIRS=$(find $START_DIR -name 'node_modules' -type d -prune)
TOTAL_DIRS=$(echo "$NODE_MODULES_DIRS" | wc -l)
# Check if there are any directories to remove
@a-c-m
a-c-m / caret-or-tilde.js
Last active December 13, 2023 15:05
caret-or-tilde.js (estlint
/*
Custom ESLint rule to disallow the use of '^' or '~' in dependencies' versions in package.json files.
(--fix works and will remove the '^' or '~' characters from the package.json file!)
eslint-plugin-package-json-dependencies/index.js
module.exports = {
rules: {
'caret-or-tilde': require('./caret-or-tilde'),
},
};