Access LM Studio API running on Windows from another device (Mac) on the same network.
All right Peter — let’s make this boringly reliable, the way infrastructure should be.
There are three sane ways to keep per-app light mode enforced on modern macOS. They differ mainly in how “enterprise” you want to get.
I’ll walk from simplest → most robust, with opinions included at no extra charge.
Option 1 — Login script (best balance of power vs simplicity)
| """ | |
| EBOOK AUDIT CENTER (V9 - CSV EXPORT & PORTABILITY) | |
| =================================================== | |
| OVERVIEW: | |
| A professional-grade ebook auditor and cataloger. | |
| This version adds the ability to export your data for use | |
| in spreadsheet software like Excel or Google Sheets. | |
| FEATURES: |
git bisect is Git’s built-in “binary search” wizard for hunting down which exact commit introduced a bug.
Instead of you guessing and checking commits one-by-one like a caveman with a keyboard, git bisect repeatedly checks out a commit halfway between a known-good state and a known-bad state. You test that commit, tell Git “good” or “bad,” and it halves the search space again. In about log₂(N) steps, you land on the first bad commit.
When you use it • A bug exists now (bad) • You know a point in history where it didn’t exist (good) • You want the first commit that made it break
Typical workflow (manual testing)
| # Try to show the contents of docs/ from the master branch. | |
| # - git show works for files, but may fail for directories. | |
| # - Suppress errors and limit output to 20 lines. | |
| # - If that fails, fall back to listing files under docs/ instead. | |
| # - Always show only the first 20 results to keep output predictable. | |
| git show master:docs/ 2>/dev/null | head -20 \ | |
| || git ls-tree -r master --name-only | grep '^docs/' | head -20 |
| #!/bin/bash | |
| # clean-branch-references.sh | |
| # Branches to clean | |
| BRANCHES=("master" "original" "go-version") | |
| for branch in "${BRANCHES[@]}"; do | |
| echo "Cleaning branch: $branch" | |
| git checkout $branch |
| # Search in files across all branches | |
| git grep -i "claude\|anthropic\|generated with.*claude\|co-authored-by.*claude" $(git rev-list --all) -- ':(exclude)go.sum' ':(exclude)go.mod' | head -50 | |
| # Search in commit messages | |
| git log --all --grep="Claude\|Generated with\|Co-Authored" --oneline | |
| # Search for specific patterns in current branch | |
| grep -r "Claude Code\|Co-Authored-By: Claude\|🤖 Generated" . --exclude-dir=.git --exclude-dir=build | |
| from PIL import Image, ImageOps | |
| import os | |
| IMAGE_EXTENSIONS = (".jpg", ".jpeg", ".png", ".tiff", ".bmp") | |
| def rotate_portrait_images(directory): | |
| for filename in os.listdir(directory): | |
| if not filename.lower().endswith(IMAGE_EXTENSIONS): | |
| continue |
| #!/usr/bin/env python3 | |
| """PDF file renaming utility based on metadata.""" | |
| import os | |
| import re | |
| from PyPDF2 import PdfReader | |
| def get_pdf_metadata(pdf_path): | |
| """ |
| #!/usr/bin/env python3 | |
| """ | |
| The Python script extracts metadata (title and author) from EPUB files and renames them based on the extracted information. | |
| :param epub_path: The `epub_path` parameter in the `get_epub_metadata` function is the file path to the EPUB file from which you want to extract the title and author metadata. You should provide the full path to the EPUB file as a string when calling this function. For example, if | |
| :return: Defines a Python script that extracts metadata (title and author) from EPUB files and renames the files based on this metadata. The `get_epub_metadata` function extracts the metadata from an EPUB file and returns a dictionary containing the title and author. The `rename_epubs` function renames EPUB files in a specified directory based on the extracted metadata. | |
| """ | |
| import os | |
| import re | |
| import xml.etree.ElementTree as ET |