Solving exercises from Freecodecamp.org using Elixir programming language. Includes benchmarks and tests for every functions.
Folders that are interesting to read can be found at:
Either use Docker, this Docker automated install script curl -sSL https://get.docker.com/ | sh
, or use asdf
.
using docker_start
shell script (use wsl on windows or git bash, otherwise this works both ?mac? and linux), or see the file if you want to use docker commands instead.
# I haven't tried this both on windows and mac, YMMV
source docker_start
Why source docker_start
instead of chmod +x ./docker_start
? read run bash script doesn't work alias command.
mix deps.get --only test
iex -S mix
# where "elixir" is the name of the container
docker container stop elixir
# temporary alias are not persisted across different sessions
# but if you want to remove them
unalias elixir iex mix elixirc
mix precommit
mix test
mix text --cover
# i.e. you want to test only "Basic Algorithms"
mix selective_test basic_algo
# or more, separated by spaces
mix selective_test basic_algo intermediate_algo
# basic_algo = Basic Algorithm Scripting
# intermediate_algo = Intermediate Algorithm Scripting
# running this generates docs in "doc/" directory
mix docs
# view benchmark commands
mix help benchmark
# list available functions
mix benchmark --list
# specific function
mix benchmark mutation
# benchmark results saved as html in "benchmarks/" directory
mix benchmark mutation --html