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 pdf 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: " |
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/zsh | |
while getopts ":f:" opt; do | |
case ${opt} in | |
f ) | |
file=$OPTARG | |
;; | |
\? ) | |
echo "Invalid option: -$OPTARG" 1>&2 | |
exit 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 | |
# This script takes two arguments: input filename and output filename | |
# It uses pandoc to convert the input file to a html file with specified options | |
# Check if the number of arguments is correct | |
if [ $# -ne 2 ]; then | |
echo "Usage: ${0##*/} input.md output.html" | |
exit 1 | |
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
#!/bin/zsh | |
# This script takes three arguments: input filename, output filename and optional font-face name | |
# It uses pandoc to convert the input file to a pdf file with specified options | |
# If no font-face name is provided, it defaults to 'Optima' | |
# Check if the number of arguments is correct | |
if [ $# -lt 2 ] || [ $# -gt 3 ]; then | |
echo "Usage: ${0##*/} input.md output.pdf [font-face]" | |
exit 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 | |
# Check the number of arguments | |
if [ $# -ne 4 ]; then | |
echo "Usage:" | |
echo " ${0##*/} <input> <output> <start> <end>" | |
echo "Arguments:" | |
echo " input the name of the input video file" | |
echo " output the name of the output video file" | |
echo " start the start time of the clip to be removed in hh:mm:ss format" |
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 the number of arguments | |
if [ $# -ne 1 ]; then | |
echo "Error: No arguments provided" | |
exit 1 | |
fi | |
display_help_menu() { |
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
// Import the required modules | |
const fs = require('fs'); | |
const path = require('path'); | |
const handlebars = require('handlebars'); | |
// Get the template and data file names from the command line arguments | |
const templateFile = process.argv[2]; | |
const dataFile = process.argv[3]; | |
// Check if the files exist and are valid |
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
$help = $false | |
if ($args -contains "-h" -or $args -contains "--help") { | |
$help = $true | |
} | |
if ($help) { | |
write-host "Usage" | |
write-host " zipnsync [options] <source> <target>" | |
write-host "" | |
write-host "Arguments" |
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
use std::collections::HashMap; | |
use regex::Regex; | |
// Define a function that returns a tuple of a hashmap of flags and values and an array of non-flag arguments | |
fn parse_args() -> (HashMap<String, String>, Vec<String>) { | |
// Create a hashmap to store the flags and values | |
let mut flags = HashMap::new(); | |
// Create an array to store the non-flag arguments | |
let mut args = Vec::new(); | |
// Create regular expressions to match different kinds of flags |
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
// Import the file system module | |
const fs = require('fs'); | |
// Import the process module | |
const process = require('process'); | |
// Define a function to convert snake_case to camelCase | |
function snakeToCamel(str) { | |
// Split the string by underscore | |
let words = str.split('_'); |