This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Run a prompt through the Claude Code CLI on Windows and return its text output. | |
| * | |
| * @param string $prompt The prompt text to send to Claude. | |
| * @param string $claudeExePath Full path to claude.exe. | |
| * @return string Claude's response (stdout + stderr combined). | |
| */ | |
| function runClaudePrompt(string $prompt, string $claudeExePath): string { | |
| // ------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| www.schneier.com##body:style(background-color: #1a1a1a !important; color: #d4d4d4 !important) | |
| www.schneier.com##a:style(color: #6cb4ee !important) | |
| www.schneier.com##a:visited:style(color: #b893d6 !important) | |
| www.schneier.com###content, .post, .entry, .comment, .sidebar, #sidebar, #wrapper, #container, .article, #main, .blog-post, div, article, section, header, footer, nav, aside:style(background-color: #1a1a1a !important; color: #d4d4d4 !important) | |
| www.schneier.com##h1, h2, h3, h4, h5, h6:style(color: #e8e8e8 !important) | |
| www.schneier.com##pre, code, blockquote:style(background-color: #2a2a2a !important; color: #d4d4d4 !important; border-color: #444 !important) | |
| www.schneier.com##input, textarea, select:style(background-color: #2a2a2a !important; color: #d4d4d4 !important; border-color: #555 !important) | |
| www.schneier.com##img:style(opacity: 0.9 !important) | |
| www.schneier.com##*:style(border-color: #333 !important) | |
| www.schneier.com##table, th, td:style(background-color: #1e1e1e !important; color: #d4d4d4 !important |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Generate a passwd file with iter=101, 12-byte salt (matching mosquitto_passwd 2.0.x) | |
| $user = getenv('MQTT_USER'); | |
| $pass = getenv('MQTT_PASSWORD'); | |
| $iter = 101; | |
| $salt = random_bytes(12); | |
| $hash = hash_pbkdf2('sha512', $pass, $salt, $iter, 64, true); | |
| $line = $user . ':$7$' . $iter . '$' . base64_encode($salt) . '$' . base64_encode($hash); | |
| echo $line . PHP_EOL; | |
| file_put_contents('/mosquitto-data/passwd', $line . PHP_EOL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Project Studio Tracker</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/lucide@latest"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0/Sortable.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: DGTE WC Category Image Fallback | |
| * Description: Shows a random product image for product categories without a category image (frontend only). | |
| * Version: 1.0 | |
| * Author: Andy Gee | |
| * Author URI: https://github.com/andyg2 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add-Type -AssemblyName System.Windows.Forms | |
| Add-Type -AssemblyName System.Drawing | |
| # 3 state badge | |
| $badgeUrl = "https://healthchecks.io/badge/37a5b3b3-74a5-43ec-9b65-c1b1b7/2lErRuPC.svg" | |
| $pollSeconds = 10 # Check every 10 seconds | |
| $gracePeriodSeconds = 30 # Must be in a bad state for 30 seconds before notifying (should be >2x multiplier of $pollSeconds) | |
| $notify = New-Object System.Windows.Forms.NotifyIcon | |
| $notify.Icon = [System.Drawing.SystemIcons]::Information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # PREFLIGHT | |
| # sudo apt update && sudo apt install -y imagemagick optipng jpegoptim webp tar findutils | |
| set -euo pipefail | |
| # ---------------------------- | |
| # Defaults | |
| # ---------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mailbox | |
| import os | |
| import argparse | |
| import re | |
| from email.utils import parsedate_to_datetime | |
| from email.header import decode_header | |
| def decode_subject(message): | |
| """ | |
| Decodes the email subject into a clean string, handling multi-line and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Define the task details | |
| $taskName = "StartDockerDesktopAtBoot" | |
| $taskDescription = "Starts Docker Desktop automatically after boot (with 2-minute delay), regardless of user login." | |
| $wrapperScriptPath = [Environment]::GetFolderPath("Desktop") + "\DockerStartWrapper.ps1" # Wrapper script on current user's desktop for delay | |
| try { | |
| # Get current user's full username for the principal | |
| $userId = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name | |
| # Check if the task already exists and remove it to avoid conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-16"?> | |
| <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
| <RegistrationInfo> | |
| <URI>\{{taskName}}</URI> | |
| </RegistrationInfo> | |
| <Triggers> | |
| <LogonTrigger> | |
| <Enabled>true</Enabled> | |
| </LogonTrigger> | |
| </Triggers> |
NewerOlder