Skip to content

Instantly share code, notes, and snippets.

@ktunprasert
Last active November 19, 2023 00:46
Show Gist options
  • Select an option

  • Save ktunprasert/1e3692c75fa9ebd95d99e1ba5fc05d98 to your computer and use it in GitHub Desktop.

Select an option

Save ktunprasert/1e3692c75fa9ebd95d99e1ba5fc05d98 to your computer and use it in GitHub Desktop.

Revisions

  1. ktunprasert revised this gist Nov 19, 2023. No changes.
  2. ktunprasert revised this gist Nov 19, 2023. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions cheat.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Cheat.sh function
    function cheat --description ="Curl commands from cheat.sh with the format 'cheat.sh/[0]/[1]/...'"
    # Arguments parsing
    # from: > cheat go :learn
    # to: go/:learn
    set path (echo $argv | sed 's/\s/\//g')
    echo $path
    # curl (echo cheat.sh/$path) | bat
    curl (echo cheat.sh/$path)
    end
  3. ktunprasert created this gist Nov 19, 2023.
    3 changes: 3 additions & 0 deletions exdoc.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    function exdoc
    elixir -e "require IEx.Helpers; IEx.Helpers.h $argv"
    end
    16 changes: 16 additions & 0 deletions git_fd.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    function git_fd
    set -l commandline (__fzf_parse_commandline)
    set -l dir $commandline[1]
    set -l fzf_query $commandline[2]
    set -l COMMAND "fd -HI -d 3 -t directory --absolute-path -g \.git $HOME $HOME/workspace $W/go/src/github.com/ktunprasert -x echo {//}"

    begin
    eval "$COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
    if [ -n "$result" ];
    cd $result
    commandline -t ""
    end
    end

    commandline -f repaint
    end