Skip to content

Instantly share code, notes, and snippets.

View Grayda's full-sized avatar
🕹️

David Gray Grayda

🕹️
View GitHub Profile
@Grayda
Grayda / index.php
Created March 26, 2019 04:14
Verify a Patreon webhook hash with PHP
<?php
// This example can be copied and pasted into Laravel.
// If you're not using Laravel, change the $request related stuff into PHP's native stuff (e.g. file_get_contents("php:///input") etc.)
function verifyPatreonHash(Request $request) {
$patreonBody = $request->getContent(); // This is the raw **body** of the request, which will be JSON (but don't json_decode it!)
$patreonSignature = $request->header('X-Patreon-Signature'); // And this is the header from Patreon
$webhookSecret = "Patreon Webhook Secret Here"; // This'll be the secret Patreon gave you when you created the webhook
$webhookHash = hash_hmac('md5', $patreonBody, $webhookSecret); // This is the hash we've calculated, based on the body and the secret
@Grayda
Grayda / WIN11-INSTALL.txt
Last active January 4, 2026 10:17
Autopilot / Intune onboarding BadKB scripts
REM This script automates the Windows 11 installation from a USB stick.
REM You'll probably need to adjust the delays to match your hardware,
REM because each machine takes a different amount of time to load various screens
DEFAULTDELAY 300
REM Move to the locale selector and select English (Australia), then press Next and then Install Now
TAB
STRING English (Australia)
ALT N
@Grayda
Grayda / README.md
Last active December 27, 2024 04:56
Infobox for Trilium Next Notes

This is an (in-progress) infobox for Trilium Next Notes.

Installation

Installing the template

  1. Create a new note somewhere (preferably under a Scripts note or something to keep everything organized)
  2. Create a new note called Infobox
  3. Create a new note under Infobox called template and make the Note Type HTML
  4. Create a new note under template and call it js and make the Note Type JS Frontend
  5. Create two new notes under js. Call the first one dayjs_plugin_relativeTime and call the second one dayjs_plugin_advancedFormat. Set both Note Types to JS Frontend