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
#!/bin/bash | |
# Function to get directory name from path | |
get_dirname() { | |
local input_path="$1" | |
local resolved_path | |
# Check if realpath exists | |
if command -v realpath >/dev/null 2>&1; then | |
# Try to resolve the path fully |
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
#!/bin/bash | |
# Script to concatenate all files in a directory and its subdirectories | |
# into a single markdown file with filenames and content preserved. | |
# Usage: ./concatenate_files_to_markdown.sh [source_directory] [output_file.md] | |
# Defaults: source_directory = current directory, output_file.md = consolidated.md | |
SOURCE_DIR="${1:-.}" | |
OUTPUT_FILE="${2:-consolidated.md}" |
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
#!/bin/bash | |
# Check if at least two arguments are provided (at least one source and one output) | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: ${0##*/} output.pdf source1.pdf [source2.pdf ... sourceN.pdf]" | |
exit 1 | |
fi | |
# The first argument is the output file | |
output_file="$1" |
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
#!/bin/bash | |
# Function to print help message | |
function print_help() { | |
app_name=${0##*/} | |
echo "Syntax: $app_name <input_image> <output_image>" | |
echo " -h: Display this help message" | |
echo "Usage: " | |
echo " $app_name input.png output.jpg" | |
echo " $app_name '*.png' output.jpg" |
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
#!/bin/bash | |
HELP_MENU="Usage: ${0##*/} [-h|--help] <rust_filename> | |
Compile and run a Rust file, then delete the binary. | |
Options: | |
-h, --help Show this help menu | |
" | |
if [ $# -eq 0 ]; then |
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
#!/bin/bash | |
# Check if the required arguments are provided | |
if [ $# -ne 2 ]; then | |
echo "Usage: ${0##*/} <file-path> <copy-count>" | |
exit 1 | |
fi | |
# Assign the arguments to variables | |
file_path=$1 |
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
#!/usr/bin/env bash | |
if [[ $# -gt 0 ]] | |
then | |
filename=$1 | |
tsuml2 --glob $filename -m -o $filename.svg | |
else | |
echo "Error: arguments missing!" | |
echo "Syntax: uml <filename>" | |
fi |
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
function fitIn(template, ...values) { | |
// console.log(template, values); | |
let result = []; | |
for (let i = 0; i < template.length; i++) { | |
result.push(template[i]); | |
if (i < values.length) { | |
result.push(values[i]); | |
} | |
} | |
return result.join(""); |
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
#!/usr/bin/env bun | |
import { parseArgs } from "node:util"; | |
const VERSION = '1.0.0'; | |
const { values, positionals } = parseArgs({ | |
args: Bun.argv, | |
options: { | |
file: { | |
type: "string", |
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
#!/bin/bash | |
# This script takes two arguments: input filename and output filename | |
# It uses imagemagick to convert the input file to a png file with specified options | |
# Check if the number of arguments is correct | |
if [ $# -ne 2 ]; then | |
app_name=${0##*/} | |
echo "Syntax: $app_name <input> <output>" | |
echo "Usage: " |
NewerOlder