Skip to content

Instantly share code, notes, and snippets.

View loretoparisi's full-sized avatar
🐍
Pythoning

Loreto Parisi loretoparisi

🐍
Pythoning
View GitHub Profile
@loretoparisi
loretoparisi / ffmpeg_frames.sh
Last active May 14, 2026 10:19
Extract all frames from a movie using ffmpeg
# Output a single frame from the video into an image file:
ffmpeg -i input.mov -ss 00:00:14.435 -vframes 1 out.png
# Output one image every second, named out1.png, out2.png, out3.png, etc.
# The %01d dictates that the ordinal number of each output image will be formatted using 1 digits.
ffmpeg -i input.mov -vf fps=1 out%d.png
# Output one image every minute, named out001.jpg, out002.jpg, out003.jpg, etc.
# The %02d dictates that the ordinal number of each output image will be formatted using 2 digits.
ffmpeg -i input.mov -vf fps=1/60 out%02d.jpg
@loretoparisi
loretoparisi / github_quick_setup.md
Last active March 17, 2026 09:33
Github Quick setup — if you’ve done this kind of thing before

Get started by creating a new file or uploading an existing file. We recommend every repository include a README, LICENSE, and .gitignore.

…or create a new repository on the command line

echo "# myrepo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/loretoparisi/myrepo.git
git push -u origin master
@loretoparisi
loretoparisi / english_contractions_dataset.json
Last active March 1, 2026 09:51
List of English contractions from Wikipedia
{
"ain't": "am not / is not / are not / has not / have not / did not",
"amn't": "am not",
"aren't": "are not",
"can't": "cannot",
"'cause": "because",
"could've": "could have",
"couldn't": "could not",
"couldn't've": "could not have",
"daren't": "dare not / dared not",
@loretoparisi
loretoparisi / LIBSTDC_FIX_INSTRUCTIONS.md
Created June 19, 2025 20:13
REPLIT LIBSTDC FIX INSTRUCTIONS

Fix for libstdc++.so.6 Missing Library Issue

Problem

The server fails to start with error: ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Solution

You need to manually create/modify these files since the system prevents automated editing:

1. Create replit.nix file in project root

@loretoparisi
loretoparisi / fix_libstdc_issue.sh
Created June 19, 2025 20:12
fix replit libstdc issue
#!/bin/bash
echo "Creating replit.nix file to fix libstdc++.so.6 issue..."
# Create replit.nix file
cat > replit.nix << 'EOF'
{ pkgs }:
pkgs.mkShell {
buildInputs = [
pkgs.python311Full
@loretoparisi
loretoparisi / thread_support.py
Created August 5, 2021 16:56
Python Thread Support with Bounder Thread Pool or Process Executor
from functools import wraps
from .bounded_pool_executor import BoundedThreadPoolExecutor
from .bounded_pool_executor import BoundedProcessPoolExecutor
_DEFAULT_POOL = BoundedThreadPoolExecutor(max_workers=5)
_PROCESS_POOL = BoundedProcessPoolExecutor(max_workers=5)
def threadpool(f, executor=None):
@wraps(f)
def wrap(*args, **kwargs):
@loretoparisi
loretoparisi / bounded_pool_executor.py
Last active April 10, 2025 20:19
Python Thread Support with Bounder Thread Pool or Process Executor
import multiprocessing
import concurrent.futures
import threading
name = 'bounded_pool_executor'
class _BoundedPoolExecutor:
semaphore = None
@loretoparisi
loretoparisi / saymp3.sh
Created February 26, 2025 21:00
saymp3: TSS to mp3
#!/bin/bash
# Function to display usage instructions
usage() {
echo "Usage: $0 [options] [\"Text to speak\"]"
echo ""
echo "Options:"
echo " -o, --output FILE Output file name (default: output.mp3)"
echo " -l, --language CODE Language code (en, es, fr, de, it, ja, zh, etc.)"
echo " -h, --help Display this help message"
@loretoparisi
loretoparisi / sanremo_music_festival_dataset_1951-2019.csv
Created January 21, 2020 00:51
Sanremo Music Festival Dataset Tracks 1951 - 2019
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 3.
track_year track_id track_pos artist_name track_name track_writers track_votes
1951 1 Nilla Pizzi Grazie dei Fiori G. C. Testoni, M. Panzeri,S. Seracini 50
1951 1 2 Nilla Pizzi,Achille Togliani "La luna si veste d'argento" V. Mascheroni,Biri 30
1951 2 3 Achille Togliani Serenata a nessuno W. Colì 20
1951 3 F Achille Togliani,Duo Fasano Al mercato di Pizzighettone N. Ravasini,A. Locatelli
1951 4 F Nilla Pizzi,Achille Togliani Eco tra gli abeti E. Bonagura,C. A. Rossi
1951 5 F Achille Togliani,Duo Fasano Famme durmì V. Panzuti,Danpa
1951 6 F Duo Fasano La cicogna distratta Da Rovere, A. Valleroni,Carrel
1951 7 F Nilla Pizzi,Duo Fasano La margherita E. B. Valdes
1951 8 F Achille Togliani Sedici anni L. Gambetti, M. Mariotti,A. Mari
say --voice="?"
Albert en_US # Hello! My name is Albert.
Alice it_IT # Ciao! Mi chiamo Alice.
Alva sv_SE # Hej! Jag heter Alva.
Amélie fr_CA # Bonjour! Je m’appelle Amélie.
Amira ms_MY # Hi my name is Amira
Anna de_DE # Hallo! Ich heiße Anna.
Bad News en_US # Hello! My name is Bad News.
Bahh en_US # Hello! My name is Bahh.
Bells en_US # Hello! My name is Bells.