Skip to content

Instantly share code, notes, and snippets.

defmodule Macros do
defmacro or_default(expr, default) do
quote do
try do
unquote(expr)
rescue
e ->
unquote(default)
end
end
defmodule Cats do
@base_dir "cats"
def run() do
pid = start()
send pid, {self, "Virginia", "Felix"}
receive do
resp -> IO.puts "Virginia/Felix: #{inspect resp}"
after 5000 ->
@brweber2
brweber2 / alexa.md
Last active May 1, 2016 20:30
Ideas for Elixir Fountain Alexa app

Elixir

Meetups

  • Where are the meetups?
  • What is the closest meetup to {City}?
  • When is the next meetup in {City}?

Conferences and Training

  • What are the upcoming conferences?
  • What training is available?
~/C/C/I/i/i/slacker (master ⚡=) > mix compile
Could not start Hex. Try fetching a new version with "mix local.hex" or uninstalling it with "mix archive.uninstall hex.ez"
** (MatchError) no match of right hand side value: {:error, {:ssl, {'no such file or directory', 'ssl.app'}}}
(hex) lib/hex.ex:5: Hex.start/0
(mix) lib/mix/hex.ex:53: Mix.Hex.start/0
(mix) lib/mix/dep/loader.ex:144: Mix.Dep.Loader.with_scm_and_app/4
(mix) lib/mix/dep/loader.ex:99: Mix.Dep.Loader.to_dep/3
(elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
(mix) lib/mix/dep/loader.ex:299: Mix.Dep.Loader.mix_children/1
(mix) lib/mix/dep/loader.ex:18: Mix.Dep.Loader.children/0
defmodule Foo do
def something() do
IO.puts "Foo in here"
end
end
Foo.something()