diff --git a/packages/copy-md-as-html.nix b/packages/copy-md-as-html.nix deleted file mode 100644 index da326d6..0000000 --- a/packages/copy-md-as-html.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ writeShellApplication, wl-clipboard, pandoc, ... }: - -writeShellApplication { - name = "copy-md-as-html"; - meta.description = '' - Convert the given Markdown to HTML (using pandoc) and copy it to the clipboard. - - This is useful for pasting Markdown content into rich text editors or GUI email clients (like Gmail). - ''; - runtimeInputs = [ wl-clipboard pandoc ]; - text = '' - set -x - pandoc "$1" -t html | wl-copy -t text/html - echo "Copied HTML to clipboard" - ''; -} diff --git a/packages/git-merge-and-delete.nix b/packages/git-merge-and-delete.nix deleted file mode 100644 index 5771e0d..0000000 --- a/packages/git-merge-and-delete.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ writeShellApplication, git, ... }: - -writeShellApplication { - name = "git-merge-and-delete"; - meta.description = '' - Merge the given branch to `main`, push and clean everything up. - ''; - runtimeInputs = [ git ]; - text = '' - # Set some fancy colors - RED='\033[0;31m' - # GREEN='\033[0;32m' - YELLOW='\033[1;33m' - BLUE='\033[0;34m' - NC='\033[0m' # No Color - - # Function to print colorful messages - print_message() { - >&2 echo -e "''${YELLOW}🚀 $1''${NC}" - } - - # Function to print and execute git commands - git_command() { - >&2 echo -e "''${BLUE}> git $*''${NC}" - git "$@" - } - - # Check if branch name is provided - if [ $# -eq 0 ]; then - echo -e "''${RED}❌ Error: No branch name provided. Usage: $0 ''${NC}" - exit 1 - fi - - BRANCH_NAME=$1 - - # Check if we're on the correct branch - current_branch=$(git_command rev-parse --abbrev-ref HEAD) - if [ "$current_branch" != "$BRANCH_NAME" ]; then - echo -e "''${RED}❌ Oops! You're not on the '$BRANCH_NAME' branch. Aborting mission!''${NC}" - exit 1 - fi - - # Check for dirty changes - if ! git_command diff-index --quiet HEAD --; then - echo -e "''${RED}❌ Houston, we have a problem! There are uncommitted changes. Commit or stash them first.''${NC}" - exit 1 - fi - - print_message "All systems go! Preparing for merge..." - - # Switch to main branch - git_command checkout main - - # Merge the specified branch into main - if git_command merge "$BRANCH_NAME"; then - print_message "Merge successful! Ready for liftoff..." - else - echo -e "''${RED}❌ Merge conflict detected! Abort! Abort!''${NC}" - exit 1 - fi - - # Push changes to remote - print_message "Pushing changes to the mothership..." - git_command push origin main - - # Delete the specified branch locally and remotely - print_message "Time to clean up our space debris..." - git_command branch -d "$BRANCH_NAME" - git_command push origin --delete "$BRANCH_NAME" - - # Run git status - print_message "And now, the final systems check..." - git_command status - - print_message "Mission accomplished! You're clear for your next adventure, Space Cowboy! 🌠" - ''; -} diff --git a/packages/twitter-convert/default.nix b/packages/twitter-convert/default.nix deleted file mode 100644 index 309095c..0000000 --- a/packages/twitter-convert/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ writeShellApplication, ffmpeg-full, ... }: - -# Some useful resources for this undocumented shit: -# - https://stackoverflow.com/q/59056863/55246 -# - https://gist.github.com/nikhan/26ddd9c4e99bbf209dd7 -writeShellApplication { - name = "twitter-convert"; - runtimeInputs = [ ffmpeg-full ]; - meta.description = '' - Convert a video for uploading to X / Twitter. - - You may need a Basic or Premium tier to upload longer videos. - ''; - text = '' - export ARSCRIPT="${./ffmpeg_ar}" - ${./ffmpeg_twitter} "$1" - ''; -} diff --git a/packages/twitter-convert/ffmpeg_ar b/packages/twitter-convert/ffmpeg_ar deleted file mode 100755 index a40aa8d..0000000 --- a/packages/twitter-convert/ffmpeg_ar +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -eval $(ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1 "$1") -#results in e.g. -#width=300 -#height=1200 -echo "height=$height"$'\n'"width=$width" -newenv=$(bc <<< "width=$width; height=$height;"$'\nscale=3; aspect=width / height;\nprint "aspect=", aspect; - print "''\n'$'";\n\nif (aspect>3) { r=(height) * (aspect/3); print "height=";} - if (aspect<(1/3)) {r=(width) / (aspect/(1/3)); print "width=";}\nscale=0 - if (r) { print r/1 }') -[ ! -z "$newenv" ] && echo "$newenv" && export $newenv -echo "aspect=""$(bc <<< "scale=3; $width/$height")" diff --git a/packages/twitter-convert/ffmpeg_twitter b/packages/twitter-convert/ffmpeg_twitter deleted file mode 100755 index 6cd45fb..0000000 --- a/packages/twitter-convert/ffmpeg_twitter +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -xe - -export $($ARSCRIPT "$1") -ffmpeg -i "$1" \ - -filter_complex 'fps=30,format=yuv420p,pad='"ceil($width/2)*2:ceil($height/2)*2"':(ow-iw)/2:(oh-ih)/2' -c:v h264_videotoolbox -c:a aac -ac 2 -ar 44100 -r 30 \ - output.mp4 \ No newline at end of file