View ffmpeg_add_srt.sh
This file contains 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 bash | |
# | |
# Using ffmpeg in Docker to add srt subtitle files to mp4 files | |
# | |
# https://mutsinzi.com/add-srt-subtitles-to-quicktime/ | |
# https://hub.docker.com/r/jrottenberg/ffmpeg | |
# Given the following directory structure: | |
# . | |
# ├── in |
View wordfreq.sh
This file contains 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 bash | |
# List the most frequently used words in a text. | |
[ $# -ge 1 ] && [ -f "$1" ] && input="$1" || input="-" | |
# shellcheck disable=SC2002 | |
cat "$input" | | |
tr -cs '[:alpha:]' '\n' | # Split words and drop non-alphabetic characters. | |
tr '[:upper:]' '[:lower:]' | # Put it all to lowercase. |
View options-avanced.sh
This file contains 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 bash | |
# “a” and “arga” have optional arguments with default values. | |
# “b” and “argb” have no arguments, acting as sort of a flag. | |
# “c” and “argc” have required arguments. | |
# getopt bin | |
getopt=/usr/local/opt/gnu-getopt/bin/getopt | |
# set an initial value for the flag |
View wait.js
This file contains 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
module.exports = delay => new Promise(resolve => setTimeout(resolve, delay)) |
View gist:756ae0369d0016b965f1e55e0f73ce93
This file contains 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
$if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/,)$if($gt(%totaldiscs%,1),%discnumber%/,)$if($ne(%albumartist%,),$num(%tracknumber%,2) ,)%title% |
View colors-64.json
This file contains 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
[ | |
"000", | |
"005", | |
"00A", | |
"00F", | |
"050", | |
"055", | |
"05A", | |
"05F", | |
"0A0", |
View gpx-routes-to-tracks.sh
This file contains 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 bash | |
# | |
# Convert GPX routes (rte) into tracks (trk) using gpsbabel. | |
# (https://www.gpsbabel.org/) | |
set -e | |
if ! type gpsbabel >/dev/null 2>&1; then | |
echo 'gpsbabel not found' | |
exit 1 |
View Makefile
This file contains 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
build: | |
cargo build --release | |
check: | |
cargo check && cargo clippy | |
fmt: | |
cargo +nightly fmt | |
doc: |
View gist:b493d0b7729c6744ccef28a8e5ca2c0c
This file contains 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
$if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/,)$if($gt(%totaldiscs%,1),%discnumber%/,)$if($ne(%albumartist%,),$num(%tracknumber%,2) ,)%title% |
View h265toh264.sh
This file contains 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 bash | |
# | |
# Description: Convert H.265 (HEVC) to H.264 (MPEG-4 AVC) | |
# Author: Josué Cau <me@josuecau.com> | |
# Date: 2018-02-16 | |
# Dependencies: ffmpeg(1) | |
set -e | |
if [ "$#" -ne 3 ]; then |
NewerOlder