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 | |
| /** | |
| * ulz.php - receiver for the `ulz` upload script. | |
| * | |
| * Drop this file into any directory on an Apache/PHP server. Uploaded zips | |
| * are stored in ./uploads next to this file (created automatically, with an | |
| * .htaccess that blocks web access to it). | |
| * | |
| * If PHP runs as CGI/FPM and auth always fails, Apache is stripping the | |
| * Authorization header. Add this to an .htaccess next to this file: |
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 { decodeEpak } from "./epak.mjs"; | |
| const buf = await fetch( | |
| "https://gaia.nullschool.net/data/gfs/current/current-wind-isobaric-1000hPa-gfs-0.5.epak", | |
| ).then((r) => r.arrayBuffer()); | |
| const { header, blocks } = decodeEpak(buf); | |
| const u = blocks[header.variables["u-component_of_wind_isobaric"].data.block]; | |
| const v = blocks[header.variables["v-component_of_wind_isobaric"].data.block]; |
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 |
NewerOlder