Exercise downloader for https://rustplatform.com/
- install the exercise downloader, open a terminal and run:
cargo install pybites-rust-download
cdto the directory where you want to save the exercises- run the downloader (free exercises only):
pybites-rust-download
- to download all exercises (requires premium), set your API key:
Or export it in your shell profile so you don't have to pass it every time:
PYBITES_API_KEY=your-api-key-here pybites-rust-download
You can find your API key on your profile page.export PYBITES_API_KEY=your-api-key-here
Once downloaded, use fzf to quickly jump between exercise directories:
cdf() {
local dir
dir=$(find . -type d | fzf --reverse --prompt='cd to> ') || return
cd "$dir"
}Add this to your shell profile, then type cdf to fuzzy-search and cd into any exercise.
Maybe you want to have a look at the code and make some changes.
- clone the repo and
cdto the main directory of the project - compile the downloader
cd exercise_downloader && \ cargo build --release
- cd back to the project main directory
cd .. - run the downloader from the project main directory
./exercise_downloader/target/release/pybites-rust-download
- the downloader will create
exercisesin the current directory
Alternatively, use the Makefile. Be aware that this will create exercises in the project main directory, where the Makefile is located.
make download-exercises(Open to see some output examples ...)
Using cargo to install from crates.io.
➜ cargo install pybites-rust-download
Installing pybites-rust-download v0.1.4
(...)
Compiling pybites-rust-download v0.1.4
Finished `release` profile [optimized] target(s) in 15.61s
Installing /my/home/.cargo/bin/pybites-rust-download
Installed package `pybites-rust-download v0.1.4` (executable `pybites-rust-download`)
➜Using make to compile and execute the exercise downloader.
➜ make download-exercises
make build-executable && \
exercise_downloader/target/release/pybites-rust-download && \
echo ... all done
make[1]: Entering directory '/my/home/github/pybites_rust'
cd exercise_downloader && \
cargo build --release
Finished `release` profile [optimized] target(s) in 0.06s
make[1]: Leaving directory '/my/home/github/pybites_rust'
Downloading the exercises from Pybites Rust (rustplatform.com) ✅
'exercises' will be created in the current directory (/my/home/github/pybites_rust/exercises)
21 exercises found!
"Strings and Slices" ✅
"URL Query Parameter Parser" ✅
"Hello Rustacean" ✅
"Vectors and Vec" ✅
"Variables and Mutability" ✅
"Json Serialization" ✅
"Simple Calculations" ✅
"Working with Enums" ✅
"Vowel Counter" ✅
"Using Structs in Rust" ✅
"Fibonacci Sequence" ✅
"Primitive Types" ✅
"Basic Tokenizer" ✅
"Reverse a String" ✅
"Variable Assigment and Mutability" ✅
"Ownership and Borrowing" ✅
"Scopes and Shadowing" ✅
"Function Return Values" ✅
"Result Handling" ✅
"Basic Struct" ✅
"Control Flow" ✅
... all doneOriginally created by Giuseppe Cunsolo.