Skip to content

Instantly share code, notes, and snippets.

View AdamGagorik's full-sized avatar

Adam Gagorik AdamGagorik

View GitHub Profile
@AdamGagorik
AdamGagorik / harpoon
Last active July 20, 2024 22:05
A script to memorize common directories
#!/usr/bin/env python3
"""
Memorize key directories and cd to them.
examples:
cd $(harpoon)
cd $(harpoon key)
harpoon add <key> <path>
harpoon register <shell>
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CACHE_FILE="${SCRIPT_DIR}/latest-clion-version.txt"
CACHE_TTL=$((60 * 60 * 24 * 7))
if [[ "$#" -gt 0 ]]; then
if [[ "$1" = "-f" ]] || [[ "$1" = "--force" ]]; then
FORCE=1
else
unbind-key C-b
set -g prefix C-a
bind-key C-a send-prefix
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g mode-keys vi
set -g mouse on
set -g status-position top
live_config_reload = true
import = [
"/home/agagorik/.config/alacritty/catppuccin/catppuccin-mocha.toml",
]
# shell = "/usr/bin/zsh"
[env]
TERM = "xterm-256color"
#!/usr/bin/env python3
import webbrowser
import argparse
import os
def default() -> list[str]:
return os.environ.get("GITHUB_PULL_REQUEST_AUTHORS", "").split(":")
#!/usr/bin/env bash
# alias tldr="~/.gists/bin/tldr"
TLDR_COMMAND=/home/linuxbrew/.linuxbrew/bin/tldr
if [ $# -eq 0 ]; then
$TLDR_COMMAND --help
exit 0
fi
#!/usr/bin/env bash
tr ':' '\n' <<< "$PATH" | fzf --no-sort | xclip -i -sel clip
#!/usr/bin/env bash
# Store the STDOUT of fzf in a variable
selection=$(find . -type d | fzf --multi --height=80% --border=sharp \
--preview='tree -C {}' --preview-window='45%,border-sharp' \
--prompt='Dirs > ' \
--bind='del:execute(rm -ri {+})' \
--bind='ctrl-p:toggle-preview' \
--bind='ctrl-d:change-prompt(Dirs > )' \
--bind='ctrl-d:+reload(find . -type d)' \
#!/usr/bin/env bash
old_url=$(git remote get-url origin)
new_url=${old_url//https:\/\//git@}
new_url=${new_url//.com\//.com:}
echo "old url: $old_url"
echo "new url: $new_url"
if [[ "${old_url}" == "${new_url}" ]]
#!/usr/bin/env bash
INP=main.tex
OUT=main.docx
REF=reference.docx
if [[ $# -ge 1 ]]; then
INP="${1%.*}.tex"
OUT="${1%.*}.docx"
fi