Resources
Answers
Examples
Log in
Create free account
What do you want to save?
Add Code snippet
New code examples in category Elixir
Awgiedawgie
2022-02-20 00:15:17
elixir function arity
inspect :erlang.fun_info(fn -> :ok end)[:arity] inspect :erlang.fun_info(fn a,b-> a+b end)[:arity] inspect fn a,b-> a+b end |> is_function inspect fn a,b-> a+b end |> is_function(1)
Add solution
Merus
2021-11-17 14:28:08
elixir join list of strings
y = Enum.join(x, ", ")
Add solution
CPP
2021-11-11 20:05:20
liveview component
<%= live_component HeroComponent, content: @content %>
Add solution
Smatterer
2021-11-07 09:50:16
elixir random number
Enum.random(0..n)
Add solution
Kelly Hess
2021-11-02 01:23:08
elixir time
# DateTime DateTime.now!("Etc/UTC") |> DateTime.add(3600*9, :second)
Add solution
Richard Holmes
2021-10-21 11:12:05
elixir reverse list
list = [1, 2, 3, 4, 5] Enum.reverse(list)
Add solution
Night Crawler
2021-10-21 04:14:04
generate random number elixir
Enum.random(0..n)
Add solution
Alana
2021-10-04 07:34:01
map merge elixir
iex> Map.merge(%{a: 1, b: 2}, %{a: 3, d: 4}) %{a: 3, b: 2, d: 4}
Add solution
SSTTLL
2021-10-04 04:34:02
elixir write base64 to file
{:ok, data} = Base.decode64(base64_string) File.write("/tmp/file.gif", data, [:binary])
Add solution
Payod Panda
2021-10-02 16:10:02
elixir list comprehension
iex> for n <- [1, 2, 3, 4], do: n * n [1, 4, 9, 16] #### > colors = [ .. "red", .. "yellow", .. "blue" .. ] > for color <- colors, do: IO.puts(color) > red > yellow > blue
Add solution
‹
1
2
›
Best helpers
daily
weekly
monthly
for 3 months
Ranking is empty
This website uses cookies to make IQCode work for you. By using this site, you agree to our
cookie policy
Pleased to see you again
Sign up to unlock all of IQCode features:
Master useful skills
Improve learning outcomes
Share your knowledge
Sign in
E-mail
Password
Recover lost password
Log in
Or log in with
Not registered?
Sign up takes less than a minute
Create a Free Account
Sign up to unlock all of IQCode features:
Master useful skills
Improve learning outcomes
Share your knowledge
Sign up
Email
Password
Sign up for free
Or sign up with
By signing up, you agree to the
Terms and Conditions
and
Privacy Policy
. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.