Skip to content

Instantly share code, notes, and snippets.

View thingsiplay's full-sized avatar

Tuncay thingsiplay

View GitHub Profile
@thingsiplay
thingsiplay / txt2png-1.1.sh
Last active April 7, 2025 13:33
Convert Text files to Image format.
#!/usr/bin/env bash
# (This version is specific for my special use case of personal documents.)
# Version 1.1
# 2025-04-07
#
# Convert Text files to Image format.
#
# Usage:
# txt2png desc1.txt desc2.txt
@thingsiplay
thingsiplay / tocase
Last active February 7, 2025 12:58
tocase - Change the lower and upper case characters.
#!/usr/bin/env bash
if [ "${#}" -eq 0 ] ; then
cat << EOF
usage: tocase option...
options:
upper all uppercase
upper1 upper first character
@thingsiplay
thingsiplay / crc32sum
Last active April 18, 2025 15:22
crc32sum - Calculate CRC32 for each file (Bash using 7z)
#!/usr/bin/env bash
if [[ "${#}" -eq 0 ]] || [[ "${1}" == '-h' ]]; then
self="${0##*/}"
cat <<EOF
usage: ${self} files...
Calculate CRC32 for each file.
positional arguments:
@thingsiplay
thingsiplay / toarchive
Last active February 12, 2025 14:25
toarchive - Create one archive for each file or folder (Bash using 7z)
#!/usr/bin/env bash
supported_ext=("7z" "zip")
help() {
cat <<EOF
toarchive ext [options] files...
toarchive zip -f -k *.smc
Convert each file to an archive using 7z, similar to gzip.
{
"version": "1.5",
"default_core_path": "/home/tuncay/.config/retroarch/cores/fbneo_libretro.so",
"default_core_name": "Arcade (FinalBurn Neo)",
"base_content_directory": "/home/tuncay/Emulation/Roms",
"label_display_mode": 0,
"right_thumbnail_mode": 2,
"left_thumbnail_mode": 0,
"sort_mode": 0,
"items": [
@thingsiplay
thingsiplay / ytvideo
Created May 19, 2024 13:07
ytvideo - YouTube video downloader wrapper to yt-dlp
#!/bin/sh
# Default values.
quality='bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4'
limit='4.8'
metaextras='--add-metadata --write-description --write-info-json --write-sub'
OPTIND=1
while getopts ':hbp:s:M' OPTION; do
case "$OPTION" in
@thingsiplay
thingsiplay / trim
Last active May 23, 2024 15:49
Remove surrounding whitespace from stdin.
#!/bin/sh
# echo -e ' \thello world ' | trim
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
@thingsiplay
thingsiplay / flatapp
Last active May 3, 2024 03:54
Run Flatpak apps by search filter or through fuzzy finder menu
#!/usr/bin/env bash
# Show info and run flatpak apps with fzf
# flatapp [arguments]
flatpak_preview() {
app="$(echo "${1}" | awk -F'\t' '{print $2}')"
flatpak info "${app}"
}
export -f flatpak_preview
@thingsiplay
thingsiplay / _output_example_Arcade Games_missing.txt
Last active April 8, 2024 21:21
Compare two RetroArch .lpl playlist files and find missing titles
'L' Of A Day
005
007: GoldenEye
025D2
025K2
025R2
1 on 1 Government
10 Jeux Interactifs / Jeux Pour Filles
10 X 10
100 in 1
@thingsiplay
thingsiplay / yayqp
Created March 25, 2024 03:53
yay query preview
#!/bin/env bash
yay_preview() {
yay -Qqil "${1}"
}
export -f yay_preview
yay_preview_output() {
yay_preview "${1}" | less