Skip to content

Instantly share code, notes, and snippets.

View Matheus-Ribeiro95's full-sized avatar

Matheus Ribeiro Matheus-Ribeiro95

  • Brazil
View GitHub Profile
@moha-abdi
moha-abdi / tts_with_pauses.py
Last active February 27, 2026 10:28
Subclass for edge_tts.Communicate but it generates the TTS with pauses as the custom SSML is not working anymore.
import asyncio
from typing import Union, Optional
from pydub import AudioSegment
import io
from edge_tts import Communicate
class NoPausesFound(Exception):
def __init__(self, description = None) -> None:
self.description = (f'No pauses were found in the text. Please '
@rfl890
rfl890 / btoa-atob-utf8.js
Created May 29, 2023 15:58
btoa and atob with UTF-8 support
function btoaUTF8(data) {
const utf8Data = new TextEncoder().encode(data);
let binaryString = "";
for (let i = 0; i < utf8Data.length; i++) {
binaryString += String.fromCharCode(utf8Data[i]);
}
return btoa(binaryString);
}
function atobUTF8(data) {
const decodedData = atob(data);
@rbpatt2019
rbpatt2019 / save_as_pdf.py
Created March 30, 2020 15:10
Save multiple images to one pdf using Pillow
from glob import glob
import os.path as path
from PIL import Image
def convert(img):
'''Convert an RGBA image to an RGB image
If the passed image has:
img.mode == 'RGBA'
then it will be converted to RGB.