Skip to content

Instantly share code, notes, and snippets.

View alco's full-sized avatar
🇺🇦

Oleksii Sholik alco

🇺🇦
View GitHub Profile
λ iex my.ex
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (0.13.3-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> use My
nil
iex(2)> 3&&4
81.0
iex(1)> OptionParser.parse(["--hello", "world"])
{[hello: "world"], [], []}
iex(2)> OptionParser.parse(["--hello", "world"], switches: [hello: [:string]])
{[hello: "world"], [], []}
iex(3)> OptionParser.parse(["--hello", "world"], switches: [hello: [:string, :optional]])
{[hello: nil], ["world"], []}
iex(4)> OptionParser.parse(["--hello=world"], switches: [hello: [:string, :optional]])
λ iex -S mix
iex(1)> Dbg.trace(self(), :call)
{:ok, [{:matched, :nonode@nohost, 1}]}
iex(2)> Dbg.call(Mix.Task, :stack)
{:ok, [{:matched, :nonode@nohost, 20}, {:saved, 1}]}
iex(3)> args = []
[]
iex(4)> Mix.Task.run("run", ["test/fixtures/help_cmd.exs"|args])
:noop
iex(5)>
iex(1)> raise 'foo'
** (ArgumentError) argument error
:erlang.apply('foo', :exception, [[]])
iex(1)> bin = "HELLO"
"HELLO"
iex(2)> raise ArgumentError, message: 'Unsupported or invalid status #{bin}'
** (ArgumentError) Unsupported or invalid status HELLO
bin = "HELLO"
spawn(fn ->
raise ArgumentError, message: "Unsupported or invalid status #{bin}"
end)
λ mix run example/example_alternative.exs
Compiled lib/uweb/router.ex
Generated uweb.app
** (FunctionClauseError) no function clause matching in MicroWeb.Router.mount/2
(uweb) /Users/alco/home/projects/uweb/example/example_alternative.exs:8: MicroWeb.Router.mount/2
/Users/alco/home/projects/uweb/example/example_alternative.exs:8: Router (module)
defmodule Fib do
def fib(0), do: 0
def fib(1), do: 1
def fib(n), do: fib(n-1) + fib(n-2)
end
IO.puts Fib.fib(20)
** (FunctionClauseError) no function clause matching in :lists.prefix/2
(stdlib) lists.erl:190: :lists.prefix("/Users/alco/Documents/git/ubuntu-erlang-elixir/elixir-v0.13.1/elixir/bin/../lib", '/Users/alco/Documents/git/ubuntu-erlang-elixir/elixir-v0.13.1/elixir/bin/../lib/elixir/ebin/Elixir.String.beam')
lib/ex_doc/html_formatter/autolink.ex:116: ExDoc.HTMLFormatter.Autolink.get_source/2
lib/ex_doc/html_formatter/autolink.ex:88: anonymous fn/4 in ExDoc.HTMLFormatter.Autolink.typespec/3
(elixir) lib/enum.ex:1819: anonymous fn/4 in Enum.map_join/3
(elixir) lib/enum.ex:1241: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir) lib/macro.ex:331: Macro.to_string/2
(elixir) lib/macro.ex:380: Macro.to_string/2
lib/ex_doc/retriever.ex:7: ExDoc.TypeNode.update_spec/2
ex_doc master
elixir v0.13.1
λ ../ex_doc/bin/ex_doc "PhoEnix" "134" _build/dev/lib/timex/ebin -m Timex -u "https://github.com/GITHUB_USER/GITHUB_REPO"
** (ExDoc.Retriever.Error) module Timex.Date.Convert.Timex.DateTime is not defined/available
lib/ex_doc/retriever.ex:54: ExDoc.Retriever.get_module/2
(elixir) lib/enum.ex:962: Enum."-map/2-lc$^0/1-0-"/2
lib/ex_doc/retriever.ex:38: ExDoc.Retriever.docs_from_modules/2
lib/ex_doc.ex:17: ExDoc.generate_docs/3
(elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/2