Skip to content

Instantly share code, notes, and snippets.

@tempelmann
tempelmann / NSStringFolded.h
Last active February 1, 2024 17:31
Case or diacritics insensitive NSString subclass for convenient use in NSDictionary, NSSet etc. as KeyType
//
// NSStringFolded.h
//
// Created by Thomas Tempelmann on 31 Jan 2024.
// Author retains no copyright - given to public domain
//
// Purpose: Provide a way to have case insensitive keys in an NSDictionary
// (see https://stackoverflow.com/a/77914964/43615)
//
@tempelmann
tempelmann / paddle-wh-verify.php
Created March 10, 2024 14:06
Paddle.com webhook verification (PHP)
// https://developer.paddle.com/webhooks/signature-verification shows code using a `Verifier` class
// to check that the message from Paddle is authentic.
// Sadly, it doesn't explain where the value for the `$request` variable comes from. It seems you need to use
// the PSR framework for that, but I was unable to find a way to use it for getting the data for the POST
// I am handling in my webhook handler.
// Fortunately, I was able to resolve this by looking into the code of the Verifier class from the SDK.
// Here's a version that does not rely on PSR. You still haveo to install Paddle's PHP SDK, though,
// see https://github.com/PaddleHQ/paddle-php-sdk/
require_once 'vendor/autoload.php'; // the path to your vendor dir created with "composer" tool