-
Notifications
You must be signed in to change notification settings - Fork 0
ElixirCookbook
- sudo apt install elixir
This tool Allows you to keep up to date with tools like Elixir and to swap between versions
-
sudo apt install curl git dirmngr gpg gawk automake autoconf gcc libssl-dev libncurses5-dev libwxgtk3.0-gtk3-dev
- This includes the packages for compiling erlang.
-
wx-config --version
-
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
-
vi ~/.bashrc
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
-
bash
-
asdf --version
- v0.8.1-a1ef92a
-
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
-
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
-
Erlang: 24.0.2
-
Elixir: 1.12
-
asdf update
-
asdf plugin-update --all
-
asdf list-all erlang
-
asdf list-all elixir
-
asdf install erlang 24.0.2
- This takes about 6min
-
asdf global erlang 24.0.2
-
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
-
asdf install elixir 1.12.0-otp-24
-
asdf global elixir 1.12.0-otp-24
-
elixir -v
- Make sure that the erlang and elixir fits together
- Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
- Elixir 1.12.0 (compiled with Erlang/OTP 24)
- Make sure that the erlang and elixir fits together
- mix new sip_server --sup
- cd sip_server
- mix deps
[] - array
- add element to the end: [1,2,3] ++ [4]
- add element to at the beginning: [0 | 1,2,3]
- cut first element [ head | rest ]
- length: Kernel.length(array)
messages = :erlang.process_info(self(), :messages)
IO.inspect(messages, label: "messages")
- cd TO_CRASH_DUMP_DIR
- iex
- :crashdump_viewer.start
messages = :erlang.process_info(self(), :messages)
IO.inspect(messages, label: "messages")
-
[^\w] - not word ???
- '^' - not
-
\w - matches letters, numbers and underscores
-
\d - matches digit
-
\s - matches spaces, tabs and newlines
-
. - matches everything except newlines.
Regex groups
-
[] - matches a single character with the bracket
- work as an 'or'
- e.g. 'gr[ae]y' will match
- 'gray' and 'grey'
-
[^] - will negate what is in the brackets
-
() - matches whole pattern or multiple patters if separated with '|' And captures it
- captures text that can be referenced by $n, where n is the capture group
- e.g. 'gr(a|e)y'
- can be used to match whole strings within the parentheses.
- you can embed capture groups in capture groups. ((\d+) \w)
-
Matching a range of characters using square brackets [] defines a character class. You can also specify a range of characters like a-z, as long as the start and end represent a contiguous range of code points
Quantifiers
- '+' - One or more.
- '*' - zero or more.
- '?' - none or one. (0 or 1 time)
- {n,m} - between n and m times.
- {1,5} - between 1 and 5, both included.
- {2,} - at least two times, but no upper limit.
- {8} - exactly 8 times.
Anchors
- '^' - pattern appears at the beginning of the string
- '$' - pattern appears at the ed of the string
See: mix xref
- mix xref callers MyMod
- mix xref graph --label runtime --only-direct
16:32:29.343 [warn] Metric type summary is unsupported. Dropping measure. metric_name:=[:handling, :time]
16:32:29.343 [warn] Metric type summary is unsupported. Dropping measure. metric_name:=[:event, :reception, :deltatime]
See:
The function call will not succeed
...
breaks the contract