From e86c74084711a75de846b3b18c33dd5c3847321e Mon Sep 17 00:00:00 2001 From: Doman Date: Fri, 23 Jul 2021 14:36:24 +0200 Subject: [PATCH] up on readme --- README.md | 17 ++++++++++++----- examples/fasttyper.sh | 10 ---------- 2 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 examples/fasttyper.sh diff --git a/README.md b/README.md index ec09ce5..d8c2abf 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,17 @@ To exit program simply complete test or press CTRL+C. ## Example scripts -```bash:examples/fasttyper.sh - +```sh +function ff() { + mkdir -p ~/.cache/fasttyper + local amount="${1:-50}" + local language="${2:-english}" + local sfile=~/.cache/fasttyper/$language + local source_path=https://raw.githubusercontent.com/Miodec/monkeytype/master/static/languages/$language.json + [[ ! -f $sfile ]] && curl -s $source_path | python3 -c "import sys, json; print('\n'.join(json.load(sys.stdin)['words']))" > $sfile + shuf -n $amount $sfile | python3 -m fasttyper +} ``` - -This script shuffles N words from cached word list, and if given word list doesnt exist it download's it. - `ff 50 english_1k` + +This shell function shuffles N words from cached word list, and if given word list doesnt exist it download's it. diff --git a/examples/fasttyper.sh b/examples/fasttyper.sh deleted file mode 100644 index 05025f1..0000000 --- a/examples/fasttyper.sh +++ /dev/null @@ -1,10 +0,0 @@ -# fasttyper -function ff() { - mkdir -p ~/.cache/fasttyper - local amount="${1:-50}" - local language="${2:-english}" - local sfile=~/.cache/fasttyper/$language - local source_path=https://raw.githubusercontent.com/Miodec/monkeytype/master/static/languages/$language.json - [[ ! -f $sfile ]] && curl -s $source_path | python3 -c "import sys, json; print('\n'.join(json.load(sys.stdin)['words']))" > $sfile - shuf -n $amount $sfile | python3 -m fasttyper -}