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 nu | |
| const dither_styles = [bayer, hackbert, floyd_steinberg, sierra2, sierra2_4a, sierra3, burkes, atkinson, none] | |
| # Create a gif from a given video file | |
| def main [ | |
| video: path # Path to the source video | |
| output: path # Path to save gif to | |
| start_time: number = 0 # When in the video the gif should start | |
| duration: number = 30 # How Long the gif should be in seconds |
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 nu | |
| # Path to folder where note files are stored | |
| const jottfile = $nu.data-dir | path dirname | path join 'jottfile.json' | |
| # Barebones note keeper with basic category support | |
| def main [] { help main } | |
| # Check if the input string matches a regex pattern | |
| def 'str like' [--case-insensitive(-i), pattern: string]: string -> bool { |
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 nu | |
| # Round the input down to the nearest multiple of a given divisor | |
| def 'round down' [divisor: number = 10]: number -> number { $in - ($in mod $divisor) } | |
| def main []: nothing -> nothing { | |
| help main | |
| } | |
| # Use two-pass encoding to compress a video to a certain filesize |
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
| # Ask user to create todo.txt file if it doesn't exist | |
| def "todo ensure-file" [ | |
| file: path = ~/todo.txt # Path to the todo file | |
| ]: nothing -> bool { | |
| if not ($file | path exists) { | |
| print "The todo file does not exist. Would you like to create it? [y/N]: " | |
| let response = input -sn 1 --default 'n' | str downcase | |
| if $response == 'y' { | |
| print $"Creating todo.txt file at ($file | path expand)." |
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 | |
| getTitle() { | |
| ffprobe "$1" 2>&1 | sed -En 's/^ *title *: (.*)/\1/p' | |
| } | |
| getArtist() { | |
| ffprobe "$1" 2>&1 | sed -En 's/^ *artist *: (.*)/\1/p' | |
| } |
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 | |
| # Initialize variables to customize output | |
| : "${FFILE:="${HOME}/.fonts/i/impact.ttf"}" # Let user choose font file | |
| : "${FSIZE:=72}" # Let user choose font size in px | |
| : "${BSIZE:=5}" # Let user choose stroke size in px | |
| : "${OFFSET:='(h*0.05)'}" # Let user choose text offset in px | |
| # TTEXT - Text to display at the top of the image | |
| # BTEXT - Text to display at the bottom of the image | |
| # Exit value index: |
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/sh | |
| repo=${RCREPOPATH:-/usr/local/repo/custom/custom.db.tar.gz} | |
| repo_name=$(echo "$repo" | awk -F '/' '{print $(NF-1)}') | |
| list=$(pacman -Sl "$repo_name" | sed '/\[installed\]/d' | cut -d ' ' -f 2) | |
| if [ -n "$list" ]; then | |
| printf 'Remove packages: %s? [Y/n]: ' "$list" | |
| read -r ans |
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/sh | |
| : "${IRIVER_DIR:=$(xdg-user-dir PICTURES)/iriver}" | |
| if [ -z "$1" ]; then | |
| [ -d "${IRIVER_DIR}" ] || mkdir -p "${IRIVER_DIR}" | |
| outfile="${IRIVER_DIR}/$(date '+%FT%T%z').png" | |
| else | |
| _base=$(dirname "$1") | |
| if [ -d "$_base" ]; then | |
| outfile=$1 | |
| else |