Last active
October 4, 2025 11:31
-
-
Save Satal/07db78bfc4d714f9c940af08593959ea to your computer and use it in GitHub Desktop.
A function that will make a directory and then change directory into it
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
| # This goes at the end of .bashrc | |
| mkcd() { | |
| mkdir -p "$1" && cd "$1" | |
| } | |
| # Based on https://stackoverflow.com/a/23328996/465404 | |
| function lazygit() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: lazygit \"commit message\"" | |
| return 1 | |
| fi | |
| git add . | |
| git commit -a -m "$1" | |
| git push | |
| } | |
| clonecd() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: clonecd <repository-url>" | |
| return 1 | |
| fi | |
| repo_url="$1" | |
| git clone "$repo_url" || return 1 | |
| # Extract folder name from repo URL | |
| folder_name=$(basename "$repo_url" .git) | |
| cd "$folder_name" || return 1 | |
| } | |
| convert_to_mp3() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: convert_to_mp3 <input_file>" | |
| return 1 | |
| fi | |
| local input_file="$1" | |
| local filename="${input_file%.*}" | |
| local output_file="${filename}.mp3" | |
| docker run --rm -v "$(pwd):/data" jrottenberg/ffmpeg -i "/data/$input_file" "/data/$output_file" | |
| } | |
| transcribe_audio() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: transcribe_audio <input_file> [model]" | |
| echo "Models: tiny, base, small, medium, large (default: base)" | |
| return 1 | |
| fi | |
| local input_file="$1" | |
| local model="${2:-base}" | |
| whisper "$input_file" --model "$model" --language en --output_format txt --output_dir . | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment