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 | |
| set -euo pipefail | |
| # CONFIG | |
| DIR="${HOME}/.transcription" | |
| mkdir -p "$DIR" | |
| WHISPER_BIN="/home/user/source/git/whisper_gpu.cpp/bin/whisper-cli" | |
| WHISPER_MODEL="/home/user/source/git/whisper_gpu.cpp/models/ggml-large-v3.bin" |
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 OpenParentDirectory() | |
| if vim.bo.filetype == "netrw" then | |
| vim.cmd("bd!") -- close netrw if already open | |
| return | |
| end | |
| local path = vim.fn.expand("%:p:h") | |
| if path == "" then return end | |
| vim.cmd("Ex " .. vim.fn.fnameescape(path)) | |
| local buf = vim.api.nvim_get_current_buf() | |
| vim.defer_fn(function() |
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
| showdef () { # Check if alias, function, or environment variable & print the definition | |
| if alias "$1" &> /dev/null; then # alias? | |
| alias "$1"; | |
| elif declare -f "$1" &> /dev/null; then # function? | |
| declare -f "$1"; | |
| elif [ -n "${!1}" ]; then # environment variable? (no$) | |
| echo "${!1}"; | |
| else | |
| echo "No alias, function, or environment variable found for '$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
| calibfind () | |
| { | |
| local cmd; | |
| local title; | |
| while [[ $# -gt 0 ]]; do | |
| case "$1" in | |
| -h | --h | -help | --help) | |
| echo "Usage:"; | |
| echo " calibfind <title> # list ebook info by title"; | |
| echo " calibfind -path <title> # return space-delimited quoted file paths"; |
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
| local function trim_edges(s) | |
| return (s or ""):gsub("^%s+", ""):gsub("%s+$", "") | |
| :gsub('^[\'"()<>%[%],]+', ""):gsub('[\'"()<>%[%],]+$', "") | |
| end | |
| local function stat(p) return vim.loop.fs_stat(p) end | |
| function OpenThing() | |
| local candidates = { | |
| vim.fn.expand("<cfile>"), | |
| vim.fn.expand("<cWORD>"), | |
| } |
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
| dump () | |
| { | |
| local id="$1"; | |
| local dir="/tmp/pane_dump"; | |
| local base="pane"; | |
| local index=1; | |
| local file; | |
| if [ -z "$id" ]; then | |
| echo "Usage: dump <pane-id>" 1>&2; | |
| return 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
| #This was made for stitching uncopyable ncurses buffers textdumped to files | |
| #Expects correct ordering of input, i.e.: pane1, pane2, pane3, etc. | |
| #Accepts UTF-8 plain text files There is no restriction on file extension, but | |
| # dumpfile names must regex match by 'pane\d+' | |
| #If a proceeding pane contains completely new content it will be appended in full and in order, | |
| # ortherwise it will append only non-overlapping tail of the next pane, effectively deduplicating overlaps. | |
| #!/usr/bin/env python3 | |
| import os | |
| import re |
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
| alias paneid='kitty @ ls | jq -r ".[] | .tabs[] | select(.is_active) | .windows[] | select(.is_focused) | .id"' |
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
| -- Log file opening to last_opened.txt | |
| vim.api.nvim_create_autocmd("BufReadPost", { | |
| callback = function() | |
| local date = os.date("%b %d, %Y") -- Format the current date | |
| local file_path = vim.fn.shellescape(vim.fn.expand("<afile>:p")) | |
| os.execute(string.format("sed -i '1i%s' /home/user/.config/nvim/last_opened.txt", date .. " " .. file_path)) | |
| end, | |
| }) |
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
| local input_file = "tG1hCDXoE-I.en.vtt" -- Change this to your VTT file path | |
| local output_file = "output.srt" | |
| -- Define input and output file paths. | |
| -- Read the entire VTT file into an array of lines. | |
| local lines = {} | |
| for line in io.lines(input_file) do | |
| table.insert(lines, line) | |
| end |
NewerOlder