Skip to content

Instantly share code, notes, and snippets.

@LucaTNT
LucaTNT / azure-text-to-speech.py
Last active April 20, 2022 15:53
Script that synthesizes EasyApple intros with Azure's text-to-speech APIs
import requests
def getToken():
req = requests.post("https://westeurope.api.cognitive.microsoft.com/sts/v1.0/issuetoken",
headers={"Ocp-Apim-Subscription-Key": "YOUR_AZURE_API_KEY_HERE"},
)
return req.text
def textToMp3(text, voice="it-IT-ElsaNeural"):
@LucaTNT
LucaTNT / sign-stripe-webhook-request.sh
Created June 26, 2022 15:45
Shell script to sign a Stripe webhook event
#!/usr/bin/env bash
WEBHOOK_DESTINATION="http://localhost:3000/stripe/webhook"
WEBHOOK_SECRET="whsec_ENTER_YOURS_HERE"
if [[ ! "$#" -eq 1 ]]; then
echo "USAGE: $0 /path/to/event.json";
exit 1;
fi
timestamp="$(date +%s)."
@LucaTNT
LucaTNT / parseTrenitaliaICS.php
Last active September 19, 2023 06:24
Parse Trenitalia ICS
<?php
// Based on CalFileParser (https://github.com/controlz/CalFileParser) by Michael Mottola
// Author: @LucaTNT
// My code is MIT licensed as well
// Inserisci qui dove salvare il file ICS sistemato
$saveTo = '/Users/luca/Downloads/AddToiCal.ics';
/*
* CalFileParser