Skip to content

soraliu/zsh-ghf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zsh-ghf

Manage knowledge fragments by github issues

Prerequisites

On OSX, you can exec the following codes

brew install zsh
brew install jq
brew install translate-shell
brew install pngpaste
brew install gawk

Make sure that you have export /usr/local/bin

# ~/.zshrc
export PATH="/usr/local/bin:$PATH"

Installation

git clone https://github.com/soraliu/zsh-ghf.git $ZSH_CUSTOM/plugins/zsh-ghf
# ~/.zshrc

plugins=(
  # ...
  zsh-ghf
  # ...
)

# ~/.ghfrc
# substitute ${user} ${token} with your own configuration
# make sure the repo is exist
export ZSH_GHF_API_URL=https://${user}:${token}@api.github.com/repos/${user}
export ZSH_GHF_REPO_NAME_FRAGMENT=dev-infra
export ZSH_GHF_REPO_NAME_LANG_LEARNING=trans

Usage

initialize

sync_all

push

push -t shell 'find . -type d -name "${dirname:-dir}"'

dict

dict -t fruit apple

tozh

tozh -t 'oral english' -t 'community' "I'v got it."

toen

toen -t 'tools' "zsh-ghf 这个插件真好用."

The workflow of Alfred

Go to release page to download workflow

Usage

The usage of workflow is almost the same as cli, the only difference is that if you omit the comment, the workflow will paste from clipboard

Commands (push, dict, tozh, toen)

# notice that `-c` should be the last arg when there is no `-t` arg
push 'find . -type d -name "${dirname:-dir}"' 'find . -type f -name "${filename:-*.ts}"' -c
push -c -t shell 'find . -type d -name "${dirname:-dir}"'
# or you can ignore the comment, and the workflow will paste from clipboard
push -t shell
# or you can pass nothing to it
push

dict -t fruit apple
# or you can ignore the comment, and the workflow will paste from clipboard
dict -t fruit
# or you can pass nothing to it
dict

EBFC

Inspired by the Ebbinghaus forgetting curve.

Prerequisites

  • terminal-notifier

On OSX, you can exec the following codes

brew install terminal-notifier

Configuration

# ~/.ghfrc
export ZSH_GHF_PATH_TO_CACHE_ROOT=~/.ghf
export ZSH_GHF_NOTIFICATION_SOUND=submarine
export ZSH_GHF_DAEMON_POLLING_INTERVAL=30
export ZSH_GHF_DAEMON_NOTIFICATION_INTERVAL=30

The workflow of Alfred

Go to release page to download workflow

Usage

Commands (ghf-daemon, ghf-sync)

# Step 1. Firstly sync issues from github
gsync
# Step 2. Start a daemon
gdaemon # same as `ghf-daemon start`
gdaemon stop
# List all issues
gls

License

MIT