This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
INFILE="file.srt" | |
OUTFILE="out-$INFILE" | |
START= | |
tac "$INFILE" | while IFS= read -r line; do | |
if sub_range="$( echo "$line" | grep " --> " )"; then | |
END="$( echo "$sub_range" | cut -d" " -f3 )" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// a simple event loop with Fibers (PHP 8 >= 8.1.0) | |
// in a style slightly inspired by Python's asyncio | |
// this will not immediately increase the throughput of your code | |
// since the functions are still executed sequentially in the event loop | |
// unless you can combine it with a non-blocking stream/socket | |
// to create the impression of io parallelism |