Skip to content

Instantly share code, notes, and snippets.

@tommy-ec
tommy-ec / stripe-live-to-test-env.php
Created February 6, 2024 15:16
PHP script to replicate Stripe's live environment products, plans, and prices to the test environment.
/*
* This script copies products, plans, and prices from Stripe's live environment to the test environment.
* It requires the Stripe PHP library (https://github.com/stripe/stripe-php).
*
* To use this script, replace $stripeLiveSecretKey and $stripeTestSecretKey with your own Stripe keys.
*
* Note: The script handles exceptions and avoids duplication by checking if the item already exists in the test environment before attempting to create it.
*/
// Using https://github.com/stripe/stripe-php
@tommy-ec
tommy-ec / country-code-to-emoji.php
Created April 13, 2023 16:02
A PHP array mapping ISO 3166-1 alpha-2 country codes to their corresponding emojis.
$countryCodeToEmoji = [
'AD' => '๐Ÿ‡ฆ๐Ÿ‡ฉ',
'AE' => '๐Ÿ‡ฆ๐Ÿ‡ช',
'AF' => '๐Ÿ‡ฆ๐Ÿ‡ซ',
'AG' => '๐Ÿ‡ฆ๐Ÿ‡ฌ',
'AI' => '๐Ÿ‡ฆ๐Ÿ‡ฎ',
'AL' => '๐Ÿ‡ฆ๐Ÿ‡ฑ',
'AM' => '๐Ÿ‡ฆ๐Ÿ‡ฒ',
'AN' => '๐Ÿ‡ฆ๐Ÿ‡ณ',
'AO' => '๐Ÿ‡ฆ๐Ÿ‡ด',