### Install Homebrew Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Installs Homebrew, a package manager for macOS and Linux, using a script downloaded from its official GitHub repository. This should be run as the new user. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Configure Docker to Start on Boot Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Enables the Docker service and containerd service to start automatically when the system boots up. ```bash sudo systemctl enable docker.service sudo systemctl enable containerd.service ``` -------------------------------- ### Install Lazydocker and Lazygit Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Installs Lazydocker, a terminal UI for Docker, and Lazygit, a terminal UI for Git, using Homebrew. ```bash brew install jesseduffield/lazydocker/lazydocker brew install lazygit ``` -------------------------------- ### Install Docker Engine Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Installs the Docker Engine, CLI, containerd.io, and necessary plugins for building and managing Docker images and containers. ```bash sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` -------------------------------- ### Install Micro Editor Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Installs the Micro text editor, a simple and modern terminal-based text editor. ```bash sudo apt install micro ``` -------------------------------- ### Install Dependencies (requirements.txt) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/kickstarting-a-modern-django-project-using-uv-in-2025.mdx Instructions for installing dependencies from a requirements.txt file using uv or pip, including virtual environment setup. ```bash # Using uv with a new virtual environment uv venv uv pip install -r requirements.txt # Or import into existing uv project uv add -r requirements.txt ``` ```bash # Create and activate virtual environment python3 -m venv .venv source .venv/bin/activate # On Windows: .\.venv\Scripts\activate # Install dependencies pip install -r requirements.txt ``` -------------------------------- ### Context7 MCP Example Workflow Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/testing-config.md An example workflow for using the Context7 MCP tool to perform deep, version-specific documentation searches. It details constructing dynamic queries based on retrieved library versions and topics. ```bash # Example Workflow: # First, find the exact library version from `package.json`. # Then, construct the query dynamically: @mcp_context7 get-library-docs --context7CompatibleLibraryID='/[org]/[project]/[retrieved-version]' --topic='[topic]' ``` -------------------------------- ### Set up Docker Repository Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Adds Docker's official GPG key and repository to the system's Apt sources for Ubuntu, enabling installation of the latest Docker versions. ```bash # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update ``` -------------------------------- ### Manual Maven Installation (All OS) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/project-level-java-maven-gradle-versioning.mdx Provides steps for manually installing Maven on any operating system by downloading binaries, extracting them, setting the MAVEN_HOME (or M2_HOME) environment variable, and updating the system's PATH. Includes an example for setting environment variables in shell configuration files. ```shell # Example for macOS/Linux in ~/.zshrc or ~/.bashrc # export MAVEN_HOME=/opt/apache-maven-3.9.6 # export PATH="$MAVEN_HOME/bin:$PATH" ``` -------------------------------- ### Manual Gradle Installation (All OS) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/project-level-java-maven-gradle-versioning.mdx Provides steps for manually installing Gradle on any operating system by downloading binaries, extracting them, setting the GRADLE_HOME environment variable, and updating the system's PATH. Includes an example for setting environment variables in shell configuration files. ```shell # Example for macOS/Linux in ~/.zshrc or ~/.bashrc # export GRADLE_HOME=/opt/gradle-8.7 # export PATH="$GRADLE_HOME/bin:$PATH" ``` -------------------------------- ### Update Package Lists and Upgrade System Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Updates the package list/index files from repositories and upgrades installed packages to their latest versions. ```bash sudo apt update sudo apt upgrade ``` -------------------------------- ### Example Environment Variables Template Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/config.md A template file providing examples of environment variables required for the application. It serves as a guide for developers to set up their local development environment correctly. ```dotenv # .env-example # Copy this file to .env and fill in your values NEXT_PUBLIC_SITE_URL=http://localhost:3000 NEXT_PUBLIC_UMAMI_WEBSITE_ID=YOUR_UMAMI_ID # AWS Credentials (example) # AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY # AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY # AWS_REGION=us-east-1 ``` -------------------------------- ### Pop!_OS 22.04 Partitioning Guide Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Defines the recommended partition scheme for Pop!_OS 22.04 installations, including EFI System Partition and Root Partition. It specifies partition names, labels, file systems, mount points, and sizes, along with a note on swap usage. ```APIDOC Partitioning Scheme for Pop!_OS 22.04: EFI System Partition: - Partition Name: EFI - Label: EFI - Create as: Primary Partition - File System: fat32 - Mount point: /boot/efi - Size: 1GB - Purpose: Stores bootloader files. Root Partition: - Partition Name: Root - Label: Pop_OS - Create as: Primary Partition - File System: ext4 - Mount point: / - Size: Remaining space - Purpose: Holds the operating system and all data. Note: Modern systems with sufficient RAM often do not require a dedicated swap partition. Pro tip: Leave 10MB free space before and after partitions for potential future adjustments. ``` -------------------------------- ### Pre-Task Workflow: Architecture Discovery Source: https://github.com/williamagh/williamcallahan.com/blob/dev/AGENTS.md Commands to discover project architecture by reading master documents and specific domain documentation. Essential for understanding existing systems before starting new tasks. ```bash # Read master architecture document docs/projects/structure/00-architecture-entrypoint.md # Identify relevant functionality domain # Read specific domain documentation: docs/projects/structure/[domain].md ``` -------------------------------- ### Install Googleapis Client Library (Bash) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/automated-sitemap-submissions-bing-google.mdx Demonstrates how to install the 'googleapis' client library using npm, bun, yarn, or pnpm. This library is essential for interacting with Google APIs, including the Search Console API. ```bash npm install googleapis # or: bun install googleapis / yarn add googleapis / pnpm install googleapis ``` -------------------------------- ### Jest Configuration and Setup Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/testing-config.md Details key configuration files for Jest testing, including the main configuration file, global setup script, and a legacy polyfills file. It also outlines the directory structure for mocks. ```APIDOC Project Testing Configuration: Key Configuration Files: - config/jest/config.ts: Primary Jest configuration. - config/jest/setup.ts: Global setup, imports @testing-library/jest-dom. - config/jest/polyfills.js: Legacy browser API shims for older Node versions (to be removed). Mocking System: - __tests__/__mocks__: Directory for manual mocks (e.g., next/navigation, next/font, static assets). VSCode Integration: - Jest extension for VSCode automatically detects and uses Jest configuration for running and debugging tests. ``` -------------------------------- ### Remove Conflicting Docker Packages Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Removes any pre-existing conflicting Docker packages to ensure a clean installation. ```bash for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done ``` -------------------------------- ### Testing Protocols: Example Test Pattern Source: https://github.com/williamagh/williamcallahan.com/blob/dev/AGENTS.md A modern testing pattern using native fetch mocking with Jest. Demonstrates how to mock API responses and assert component behavior. ```typescript // ✅ CORRECT: Modern testing with native fetch beforeEach(() => { global.fetch = jest.fn(); // Native Node 22 fetch, no imports }); it('should handle API response', async () => { jest.mocked(global.fetch).mockResolvedValueOnce({ ok: true, json: async () => ({ data: 'test' }), } as Response); render(); expect(await screen.findByText('test')).toBeInTheDocument(); }); ``` -------------------------------- ### Install JDK on Windows Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/project-level-java-maven-gradle-versioning.mdx Provides instructions for installing the JDK on Windows by downloading an installer from Oracle or Adoptium. It details setting the JAVA_HOME system environment variable and adding the JDK's bin directory to the system PATH for command-line access. ```powershell 1. Download the Windows `.exe` or `.msi` installer from Oracle or Adoptium. Adoptium provides prebuilt, TCK-certified OpenJDK binaries under the Eclipse Temurin project. These are free to use, community-supported, and a popular choice for OpenJDK distributions. 2. Run the installer. Default location is often `C:\Program Files\Java\jdk-21` or similar. 3. Set Environment Variables: - Search for "environment variables" and select "Edit the system environment variables". - Click "Environment Variables...". - Under "System variables", click "New..." - Variable name: `JAVA_HOME` - Variable value: `C:\Program Files\Java\jdk-21` (adjust to your installation path) - Find the `Path` variable in "System variables", select it, and click "Edit...". - Click "New" and add `%JAVA_HOME%\bin`. - Click OK on all dialogs. 4. Open a new Command Prompt or PowerShell and verify: ```powershell java -version echo %JAVA_HOME% ``` ``` -------------------------------- ### IndexNow Verification File Setup Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/automated-sitemap-submissions-bing-google.mdx Explains the process for setting up the IndexNow verification file. This involves choosing a unique key, creating a text file with the key as its name (e.g., `YOUR_KEY.txt`) in the public directory, and ensuring the file's content is only the key itself. ```APIDOC IndexNow Verification: 1. Generate/Choose Key: - Select a unique string for your `INDEXNOW_KEY`. 2. Create Verification File: - In your project's public directory (or static file directory), create a text file. - Filename: `YOUR_KEY.txt` (e.g., `abcdef12345.txt` if key is `abcdef12345`). 3. File Content: - The file must contain *only* the key string itself (e.g., `abcdef12345`). - No extra characters, spaces, or the `.txt` extension within the file content. 4. Accessibility: - The verification file must be publicly accessible on your live domain (e.g., `https://your-domain.com/YOUR_KEY.txt`). - Submissions may fail if the file is not accessible or if attempted against `localhost`. ``` -------------------------------- ### Install pnpm Package Manager Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs pnpm, a fast and efficient Node.js package manager, globally using npm. It offers disk space efficiency and faster installs. ```shell npm install -g pnpm ``` -------------------------------- ### Install and Use SDKMAN! for Java Version Management (Bash) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/project-level-java-maven-gradle-versioning.mdx Provides instructions for installing and using SDKMAN!, a tool for managing parallel versions of multiple Software Development Kits, including Java. It covers the installation script, sourcing the SDKMAN! environment, installing a specific Java version, and switching to it for the current shell. ```bash curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" # Example install and use sdk install java 17.0.10-tem sdk use java 17.0.10-tem ``` -------------------------------- ### Install uv Python Packager Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs uv, a fast Python package installer and dependency resolver, using a shell script. It aims to replace pip and other Python packaging tools. ```shell curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install and Use jenv for Java Version Management (Bash) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/project-level-java-maven-gradle-versioning.mdx Details the installation and usage of `jenv`, a command-line tool for managing multiple Java versions. It includes installation via Homebrew on macOS, configuring the shell environment, and adding installed JDKs to `jenv` for management. ```bash brew install jenv # Add to shell config (e.g., ~/.zshrc) echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc echo 'eval "$(jenv init -)"' >> ~/.zshrc source ~/.zshrc # Add an installed JDK jenv add /opt/homebrew/opt/openjdk@11 # Add installed JDK ``` -------------------------------- ### Install Python and pip Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs Python 3 and its package installer, pip, using the apt package manager, common on Debian-based Linux distributions. ```shell sudo apt install python3 python3-pip ``` -------------------------------- ### Core Jest Setup Utilities (jest/core-setup.ts) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/file-overview-map.md Contains core utility functions and setup logic for Jest tests. This file helps in abstracting common setup patterns, making test files cleaner and more maintainable. ```typescript // Placeholder for jest/core-setup.ts content // Example: export const mockApi = () => { /* ... */ }; ``` -------------------------------- ### Install and List Python Packages Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/kickstarting-a-modern-django-project-using-uv-in-2025.mdx Provides commands for managing Python packages using both `uv` and `pip`. Includes installing a package and listing all installed packages to resolve `ModuleNotFoundError`. ```bash # Install package using uv uv add # Verify installed packages with uv uv pip list ``` ```bash # Install package using pip pip install # Verify installed packages with pip pip list ``` -------------------------------- ### Install Gradle on Linux (SDKMAN!) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/project-level-java-maven-gradle-versioning.mdx Installs Gradle on Linux using SDKMAN!, a tool for managing parallel versions of multiple Software Development Kits, and verifies the installation by checking the Gradle version. ```bash sdk install gradle # Verify installation gradle -v ``` -------------------------------- ### Run Initial Setup/Migrations Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/kickstarting-a-modern-django-project-using-uv-in-2025.mdx Commands to execute initial setup tasks or database migrations for the project, using uv, pip, or Docker. ```bash uv run manage.py migrate ``` ```bash python manage.py migrate ``` ```bash docker-compose exec web python manage.py migrate ``` -------------------------------- ### Mocking Global Fetch in Jest Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/testing-config.md Demonstrates the standard pattern for mocking the global `fetch` function in Jest tests. This approach provides control over API responses, eliminates network latency, and isolates tests. It includes setup for mocking before tests and restoring mocks after each test, along with an example of overriding the mock for a specific test case. ```typescript // In your test file: my-component.test.ts // Mock global.fetch before all tests beforeEach(() => { global.fetch = jest.fn(() => Promise.resolve({ ok: true, json: () => Promise.resolve({ data: 'mocked response' }), }) ) as jest.Mock; }); // Clear mocks after each test afterEach(() => { jest.restoreAllMocks(); }); it('should render data fetched from an API', async () => { // You can override the global mock for a specific test case jest.spyOn(global, 'fetch').mockImplementationOnce(() => Promise.resolve({ ok: true, json: () => Promise.resolve({ user: { name: 'William' } }), }) ); render(); // Assert that the component renders the mocked data expect(await screen.findByText('William')).toBeInTheDocument(); // Verify that fetch was called expect(global.fetch).toHaveBeenCalledWith('/api/user', expect.anything()); }); ``` -------------------------------- ### Manage AppImage Applications Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Provides instructions for installing and integrating AppImage applications into the system. It covers creating a dedicated directory, making AppImages executable, moving them, and creating desktop entries for easy launching. ```bash # Create applications directory sudo mkdir -p /opt/applications # For each AppImage: # Make executable chmod +x your-app.AppImage # Move to applications directory sudo mv your-app.AppImage /opt/applications/ # Create desktop entry for the application cat << EOF > ~/.local/share/applications/your-app.desktop [Desktop Entry] Name=Your App Name Exec=/opt/applications/your-app.AppImage Icon=/path/to/icon.png Type=Application Categories=Utility; EOF ``` -------------------------------- ### Create New User with Sudo Privileges Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Creates a new user account, adds it to the `sudo` group for administrative privileges, and adds it to the `docker` group to manage Docker without `sudo`. ```bash # Create new user sudo adduser <> # Add to sudo group sudo usermod -aG sudo <> # Add to docker group sudo usermod -aG docker <> ``` -------------------------------- ### Add SSH Keys for New User Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/new-virtual-machine-server-setup-checklist.mdx Sets up the `.ssh` directory and `authorized_keys` file for a new user, copying existing keys or allowing manual addition of public keys, ensuring correct ownership and permissions. ```bash # Create .ssh directory sudo mkdir -p /home/<>/.ssh sudo chown <>:<> /home/<>/.ssh sudo chmod 700 /home/<>/.ssh # Copy root's authorized_keys to new user (if exists) if [ -f /root/.ssh/authorized_keys ]; then sudo cp /root/.ssh/authorized_keys /home/<>/.ssh/ sudo chown <>:<> /home/<>/.ssh/authorized_keys sudo chmod 600 /home/<>/.ssh/authorized_keys fi # Or manually add your public key if needed # echo "your-public-key" | sudo tee /home/<>/.ssh/authorized_keys ``` -------------------------------- ### Fly.io Deployment Commands Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/how-i-host-my-apps-how-to-deploy-in-2025.mdx Commands to initialize a new Fly.io application and deploy it. These are typical steps for getting an application live on the Fly.io platform. ```bash # Initialize a new Fly.io app and deploy flyctl launch flyctl deploy ``` -------------------------------- ### CLI Execution Examples (Bash) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/automated-sitemap-submissions-bing-google.mdx Illustrates command-line execution patterns for a submission script using Node.js. These examples show how to trigger different submission modes (sitemaps only, individual URLs only, or both) via command-line arguments. ```bash # Example command using Node.js; adapt for your runtime (e.g., Bun, Deno) node path/to/your/submit-sitemap.ts --sitemaps-only node path/to/your/submit-sitemap.ts --individual-only node path/to/your/submit-sitemap.ts ``` -------------------------------- ### Sentry Example Page (log-error-debug-handling, typescript) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/file-overview-map.md A demonstration page for Sentry error tracking integration. It's designed to simulate errors for testing the logging and debugging setup. ```typescript // sentry-example-page/page.tsx 'use client'; import * as Sentry from '@sentry/nextjs'; export default function SentryExamplePage() { const throwError = () => { throw new Error('This is a test error from SentryExamplePage'); }; const captureMessage = () => { Sentry.captureMessage('This is a test message from SentryExamplePage'); }; return (

Sentry Example

); } ``` -------------------------------- ### Create Django Project Files and Run Server with pip Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/kickstarting-a-modern-django-project-using-uv-in-2025.mdx Creates the Django project structure using `django-admin startproject`, applies initial database migrations with `python manage.py migrate`, and starts the development server with `python manage.py runserver`. These commands are executed after activating the virtual environment set up with pip. ```bash # Create project files (replace "config" with preferred name) django-admin startproject config . # Apply initial migrations python manage.py migrate # This command applies database migrations, setting up the necessary tables. # By default, Django uses an SQLite database stored in a file named db.sqlite3 # in your project's root directory if no other database is configured. # Run development server python manage.py runserver ``` -------------------------------- ### Example Environment Variables (.env-example) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/file-overview-map.md An example file demonstrating the structure and expected environment variables for the project. It serves as a template for creating the actual `.env` file used during development and deployment. ```dotenv # Placeholder for .env-example content # Example: DATABASE_URL=postgresql://user:password@host:port/database # Example: API_KEY=your_api_key_here ``` -------------------------------- ### Using jest.mocked() Helper for Typed Mocks Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/testing-config.md Demonstrates the modern standard for typing mocked functions and modules using `jest.mocked()`, replacing deprecated methods. Includes examples for deep and shallow mocks, emphasizing type safety. ```typescript import { myFunction } from '../my-function'; jest.mock('../my-function'); // New standard: provides deep mock types const mockedMyFunction = jest.mocked(myFunction); mockedMyFunction.mockReturnValue('new value'); // For shallow mocks (rarely needed) const shallowMock = jest.mocked(myFunction, { shallow: true }); ``` -------------------------------- ### Install Node.js and npm via NVM Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs Node Version Manager (NVM) and subsequently Node.js and npm. NVM allows managing multiple Node.js versions. ```shell curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ``` -------------------------------- ### Runner Script for Sitemap Submission (TypeScript) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/automated-sitemap-submissions-bing-google.mdx An example of a runner script in TypeScript that imports and executes functions for submitting sitemaps to search engines. It uses 'dotenv/config' for environment variables and demonstrates an async IIFE pattern for execution. ```typescript import 'dotenv/config'; // For loading environment variables import { submitSitemapFilesToSearchEngines, submitIndividualUrlsToGoogle } from './path/to/your/submit-sitemap'; // Adjust path as needed (async () => { await submitSitemapFilesToSearchEngines(); await submitIndividualUrlsToGoogle(); // Optional, if implementing individual URL submission })(); ``` -------------------------------- ### FXML Controller Path and Annotations Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/how-to-setup-the-java-sdk-and-use-javafx-on-macos-windows.mdx Demonstrates correct FXML controller setup, including the fully qualified `fx:controller` path, the requirement for a no-argument constructor, and the use of `@FXML` annotations for UI element binding. Also shows correct resource loading paths for FXML files. ```xml ... ``` ```java // PrimaryController.java public class PrimaryController { @FXML private Label myLabel; // fx:id="myLabel" @FXML private void initialize() { /* ... */ } // Must have a no-argument constructor, implicitly provided if no other constructors are defined. } ``` ```java Parent root = FXMLLoader.load(getClass().getResource("primary.fxml")); // Relative to class // Or: FXMLLoader.load(getClass().getResource("/com/example/yourproject/primary.fxml")); // Absolute from classpath root ``` -------------------------------- ### Configure Project JDK in IntelliJ IDEA (APIDOC) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/project-level-java-maven-gradle-versioning.mdx Guides users on setting the project-specific JDK within IntelliJ IDEA. This is done through the Project Structure settings, allowing selection of an installed JDK for the current project. This setting primarily affects the IDE's build and run configurations. ```APIDOC IntelliJ IDEA Project JDK Configuration: Access: File > Project Structure... > Project > SDK Action: Select the desired project JDK from the dropdown list. Purpose: Sets the Java Development Kit used for building and running the current project within the IDE. ``` -------------------------------- ### TypeScript Error Handling Usage Example Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/linting-formatting.md Demonstrates how to use the `logError` and `createContextualError` utilities within a try-catch block. This pattern ensures that errors encountered during critical operations are logged and re-thrown with added context, aiding in debugging and error tracking. ```typescript import { logError, createContextualError } from "@/lib/utils/error-handling"; try { await complexOperation(); } catch (error: unknown) { logError("ComplexOperation", error); throw createContextualError("ComplexOperation", error); } ``` -------------------------------- ### Build and Start Docker Containers Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/kickstarting-a-modern-django-project-using-uv-in-2025.mdx Command to build Docker images and start the services defined in a docker-compose.yml file. ```docker # Build and start containers docker-compose up --build ``` -------------------------------- ### Install Homebrew Package Manager Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs Homebrew, a popular package manager for macOS and Linux, enabling easy installation of software. This command uses a bash script fetched via curl. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Dockerfile for Containerization (Dockerfile) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/file-overview-map.md Defines the steps to build a Docker image for the application. It specifies the base image, dependencies, build commands, and runtime configuration. ```dockerfile # Placeholder for Dockerfile content # Example: FROM node:18-alpine # WORKDIR /app # COPY package*.json ./ # RUN npm install # COPY . . # RUN npm run build # EXPOSE 3000 # CMD ["npm", "start"] ``` -------------------------------- ### Zod v4 Top-Level Validators Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/linting-formatting.md Highlights the modern Zod v4 pattern for using top-level validator functions, which are more tree-shakeable and efficient. This contrasts with the older, deprecated method of chaining validators onto `z.string()`. Examples include `z.email()`, `z.uuid()`, and `z.url()`. ```typescript // ✅ DO - v4 pattern (tree-shakeable) z.email(); z.uuid(); z.url(); // ❌ DON'T - Old pattern (deprecated) z.string().email(); z.string().uuid(); ``` -------------------------------- ### Next.js Server Component Caching Source: https://github.com/williamagh/williamcallahan.com/blob/dev/docs/projects/structure/linting-formatting.md Shows how to leverage the `'use cache'` directive in Next.js 15 for server components. This directive memoizes the result of an asynchronous function, preventing redundant data fetching and improving performance. The example demonstrates caching a user data fetch. ```typescript // Use 'use cache' directive async function getUsers() { 'use cache'; const response = await fetch('https://api.example.com/users'); const data = await response.json(); return UserSchema.array().parse(data); } ``` -------------------------------- ### Automate Sitemap Submission with npm Script Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/automated-sitemap-submissions-bing-google.mdx Example `package.json` script entry to automate the execution of a sitemap submission script using Node.js. This allows integration into build processes or manual execution via npm commands, facilitating regular sitemap updates to search engines. ```json { "scripts": { "submit-sitemaps": "node path/to/your/submit-sitemap.ts" } } ``` -------------------------------- ### Set Micro as Default Editor and Configure Git Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs the Micro text editor and configures it as the default system editor and Git editor. This involves using `update-alternatives` and setting environment variables in `.bashrc`. ```bash # Install Micro editor sudo apt install micro # Set Micro as the default editor sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/micro 100 sudo update-alternatives --config editor # Configure Micro as the default editor for Git echo 'export VISUAL=micro' >> ~/.bashrc echo 'export EDITOR=micro' >> ~/.bashrc source ~/.bashrc ``` -------------------------------- ### Install Lazydocker Docker TUI Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs Lazydocker, a terminal UI for Docker, using Homebrew. It provides an interactive way to manage Docker containers and images. ```shell brew install jesseduffield/lazydocker/lazydocker ``` -------------------------------- ### Go S3 Integration Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/vercel-blob-vs-hetzner-digitalocean-aws-s3-object-storage-comparison.mdx Illustrates using the AWS SDK for Go to connect with S3-compatible services. Includes setup for AWS S3 and Hetzner, demonstrating how to configure custom endpoints and static credentials. The example shows client initialization. ```Go package main import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/s3" ) func main() { // Configure for AWS S3 cfg, _ := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider( "YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "", )), ) s3Client := s3.NewFromConfig(cfg) // For Hetzner or DigitalOcean, add custom endpoint resolver customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) { return aws.Endpoint{ URL: "https://s3.eu-central-1.hetzner.com", }, nil }) hetznerCfg, _ := config.LoadDefaultConfig(context.TODO(), config.WithRegion("eu-central-1"), config.WithEndpointResolverWithOptions(customResolver), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider( "YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "", )), ) hetznerClient := s3.NewFromConfig(hetznerCfg) // Upload example // s3Client.PutObject(...) } ``` -------------------------------- ### Bash: Test Spring Boot REST API with cURL Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/setting-up-modern-spring-boot-web-server-rest-api-web-content-2025-guide.mdx Provides examples of using the cURL command-line tool to test the '/hello' endpoint of a running Spring Boot application. It shows how to make requests with and without a query parameter. ```Bash curl http://localhost:8080/hello curl http://localhost:8080/hello?name=Developer ``` -------------------------------- ### Install Lazygit Git TUI Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/pop-os-22-micro-pc-server-setup.mdx Installs Lazygit, a terminal UI for Git, using Homebrew. This simplifies Git operations through an interactive interface. ```shell brew install lazygit ``` -------------------------------- ### Submit Sitemap to Bing IndexNow API (TypeScript) Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/automated-sitemap-submissions-bing-google.mdx A TypeScript function to submit a sitemap URL to Bing via the IndexNow API. It retrieves an API key from environment variables and uses the fetch API to make a GET request. Includes checks for the API key and response status. ```typescript async function submitSitemapToBing(siteUrl: string, sitemapUrl: string): Promise { const indexNowKey = process.env.INDEXNOW_KEY; // From an environment variable if (!indexNowKey) { console.error('[SitemapSubmitBing] ❌ INDEXNOW_KEY not set. Skipping Bing/IndexNow submission.'); return false; } try { const host = new URL(siteUrl).host; const indexnowUrl = `https://www.bing.com/indexnow?url=${encodeURIComponent(sitemapUrl)}&key=${indexNowKey}&host=${host}`; const response = await fetch(indexnowUrl, { method: 'GET' }); if (response.ok) { console.log(`[SitemapSubmitBing] ✅ Successfully submitted sitemap (${sitemapUrl}) via IndexNow to Bing`); return true; } console.error(`[SitemapSubmitBing] ❌ IndexNow submission failed: ${response.status} ${response.statusText}`); return false; } catch (error) { console.error('[SitemapSubmitBing] ❌ Error submitting via IndexNow to Bing:', error.message); return false; } } ``` -------------------------------- ### Install Django with pip Source: https://github.com/williamagh/williamcallahan.com/blob/dev/data/blog/posts/kickstarting-a-modern-django-project-using-uv-in-2025.mdx Installs Django using the standard pip package manager. This process includes creating a project directory, setting up a virtual environment using `python3 -m venv`, activating the environment, installing Django with `pip install django`, and verifying the installation with `django-admin --version`. Activation is required for subsequent commands. ```bash # 1. Create project directory and setup environment mkdir my_django_project && cd my_django_project python3 -m venv .venv source .venv/bin/activate # On Windows: .\.venv\Scripts\activate # 2. Install Django pip install django # 3. Verify installation django-admin --version ``` -------------------------------- ### Bun Development & Testing Commands Source: https://github.com/williamagh/williamcallahan.com/blob/dev/AGENTS.md Essential commands for running development servers, building production versions, validating code quality, and executing tests using the Bun runtime. Emphasizes correct testing practices by avoiding direct `bun test` usage. ```bash # Development & Building bun run dev # Development server bun run build:only # Production build bun run validate # MANDATORY before commits (0 errors/warnings) # Code Quality bun run lint && bun run biome:lint # Linting bun run type-check # TypeScript validation # Testing (NEVER use 'bun test' directly!) bun run test # ✅ CORRECT - Full test suite with Jest bun run test:watch # ✅ CORRECT - Watch mode bun run test:coverage # ✅ CORRECT - Coverage report # ❌ FORBIDDEN: bun test (bypasses Jest configuration) ```