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
#!/bin/bash | |
## Count all files including hidden in a given directory | |
countf() { | |
ls -lAR "$1" | grep '^-' | wc -l | |
} | |
## Count all non-hidden files in a given directory | |
countf_a() { | |
ls -lR \$1 | grep '^-' | wc -l |
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
#!/bin/bash | |
# Script to decode base64 and pretty-print JSON while supporting standard base64 options | |
# Check for jq dependency | |
check_dependencies() { | |
if ! command -v jq &>/dev/null; then | |
echo "Error: This script requires 'jq' but it's not installed." >&2 | |
echo "To install jq on macOS, run: brew install jq" >&2 | |
echo "For other platforms, visit: https://stedolan.github.io/jq/download/" >&2 |
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 | |
# | |
# mov2gif - Convert a video to an optimized GIF using FFmpeg. | |
# Utilizes a two-pass palette generation method. | |
# Default values | |
FPS=10 | |
SCALE=320 | |
OUTPUT="" |
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
#!/bin/bash | |
# Default values | |
base_branch="" | |
compare_branch="" | |
verbose=false | |
compare_all=false | |
# Help documentation | |
usage() { |
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
#!/bin/bash | |
## List all files and exclude directories in current directory (ls -p adds trailing slash to directories | ls -x displays mul$ | |
alias lsf="ls -apx | grep -v /" | |
## List only directories in current path | |
alias lsd="ls -d -1 */ | lolcat" |
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
#!/bin/bash | |
# Store the last checked directory to avoid redundant `.nvmrc` checks | |
LAST_NVM_DIR="" | |
# Load the correct Node.js version based on the `.nvmrc` file | |
load_nvmrc() { | |
# Get the current working directory | |
local current_dir="$(pwd)" |
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
#!/bin/bash | |
# Find the correct docker-compose file | |
if [ -f "docker-compose.yml" ]; then | |
DOCKER_COMPOSE_FILE="docker-compose.yml" | |
elif [ -f "docker-compose.yaml" ]; then | |
DOCKER_COMPOSE_FILE="docker-compose.yaml" | |
else | |
echo "Error: Could not find 'docker-compose.yml' or 'docker-compose.yaml'." | |
exit 1 |
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
#!/bin/bash | |
### Keep the Gist updated! | |
# https://gist.github.com/skwid138/b360dbab95bee28a424f350301454092 | |
### | |
# File paths | |
DOCKERFILE="Dockerfile" | |
# Extract the image used in the builder stage (case-insensitive) |
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
#!/bin/bash | |
# Default values | |
base_branch="" | |
compare_branch="" | |
# Help documentation | |
usage() { | |
echo "Usage: $0 [OPTIONS]" | |
echo "" |
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
#!/bin/bash | |
# Default values for optional arguments | |
VOICE="" | |
MESSAGE="workflow completed" | |
WORKFLOW_NAME="" | |
function show_help() { | |
echo "Usage: workflow_tail.sh [options]" | |
echo "" |
NewerOlder