Skip to content

Instantly share code, notes, and snippets.

View shirobachi's full-sized avatar

Simon Hryszko shirobachi

View GitHub Profile

Sup, fellow command-line wizards!

You know what's wild? I installed some Git aliases in my zsh, and I'm like, "How the heck am I going to remember all these shortcuts?!"

But then, boom! I got my thinker thinking, and I whipped up this rad little script. It runs before every command you enter, checking for matching aliases and giving you a heads up if any are available to make your life easier and cooler.

Here's what it looks like:

@shirobachi
shirobachi / answer.sh
Last active March 15, 2023 21:49
Bunch of useful bash functions
# $1 - question
# $2 - possible answers (space separated)
# $3 - optional function to call with the answer
# $4-end - optional parameter to pass to the function
function answer(){
QUESTION=$1
POSSIBLE_ANSWERS=$2
DEFAULT_ANSWER=$(echo $POSSIBLE_ANSWERS | tr ' ' '\n' | grep -oP '.*[A-Z].*' | tr '\n' ' ' | tr -d ' ') # default answer is the one what have capital letter
FUNCTION=$3
[[ $# -ge 4 ]] && shift 3 && PARAMETERS=$*
@shirobachi
shirobachi / README.md
Last active March 5, 2023 20:33
taskwarrior subtask

taskwarrior subtask

This is simple script for making subtasks in taskwarrior. Very useful if use taskwarrior-tui.

Installation

Autoupdate

[[ ! -f /tmp/task-subtasks.sh ]] && curl -s https://gist.githubusercontent.com/SimonHryszko/462afc1a03b6e5038018e0f989b39175/raw/68e33386d00d90007c8f780da9cc227f22a4957f/task-subtasks.sh -o /tmp/task-subtasks.sh; chmod +x /tmp/task-subtasks.sh

Manual

@shirobachi
shirobachi / README.md
Last active March 5, 2023 20:27
Taskwarrior-tui copy to clipboard

copy-to-clipboard

Thanks for stepping by!
This is not perfect but it work (on my machine) any problem you welcome to share in comments :)

How it work

It search in task's description and annotations urls, phones and emails, then let you choose whitch to copy to clipboard with rofi. It will show uniq values of:

  • task description (title)
  • task's annotations
  • found emails, phone, mails