https://nickjanetakis.com/blog/awesome-git-diffs-with-delta-fzf-and-a-little-shell-scripting #GitDiffs #ProductivityHacks #ShellScripting #TechHumor #HackerNews #ngated
Improved Git Diffs with Delta, Fzf and a Little Shell Scripting
https://nickjanetakis.com/blog/awesome-git-diffs-with-delta-fzf-and-a-little-shell-scripting
#HackerNews #ImprovedGitDiffs #Delta #Fzf #ShellScripting #GitTips
TL;DW for the video:
Lock Fix: Detects/removes stale db.lck.
PGP Engine: Auto-fetches missing keys.
Wiki Deep-link: [w] opens the specific Wiki page for the error.
Smart Search: Finds package owners for missing binaries.
Repo: https://github.com/Rakosn1cek/mend (2/2)
With regular access to linux for not just work stuff, I’m trying to do things with media files to work appropriately with Jellyfin and ffmpeg is the go to. Not wanting to do everything by hand, I turn to scripts. I found a lovely script, but it’s set up to be manually edited or limited to working from specific directories and I want to be more flexible.
So now I must learn to go beyond the basics (I’ve already done input prompts): working with and validating arguments.
I made my little sample script to use as reference because relying on Internet searches these days to find obscure answers (or reading dry documentation that doesn’t immediately cover what I’m trying to do) just doesn’t cut it. 😅
Oops. Got distracted with figuring out how I want the emoji picker to work. Where was I…
Ah, yes. I’m leveling up my bash scripting skills.
I got annoyed at having to know how many lines I want to `head` or `tail`, and having to write the same stuff over and over again using `cat -n` / `grep` (or even worse an awk script) to figure them out on the fly, so ... two new scripts, `ignore-after` and `ignore-up-to` which are basically content-based versions of `head` and `tail`.
You're welcome.
https://github.com/DrHyde/shellscripts/commit/73b79e211ebaacbb9bc4f296fd1db6d2174b6f9e
Bash expansion explained for beginners. Learn brace, tilde, parameter, command, arithmetic, process, globbing, word splitting, and quote removal with practical examples.
Full guide here: https://ostechnix.com/bash-expansion-beginners-guide/
If you’re writing shell scripts, start adding this:
set -euo pipefail
It forces your script to:
• Exit on errors
• Fail on unset variables
• Catch broken pipes
Small line. Big reliability boost.
"Bashtorio: Build conveyor belt factories that process data through real Unix commands running in an in-browser Linux VM. A Factorio-inspired browser game."
Am I the only one that never, ever uses getopt/getops in shell scripts?
Just writing your own argument parser seems so much easier to do. :/