Skip to content

Instantly share code, notes, and snippets.

View todd's full-sized avatar
🤘

Todd Bealmear todd

🤘
View GitHub Profile
@todd
todd / learning_plug.ex
Created March 10, 2016 02:12
Learn Me Some Plug
defmodule LearningPlug do
use Plug.Builder
plug Plug.Logger
plug :extract_name
plug :greet, %{my_option: "Hello"}
def extract_name(%Plug.Conn{request_path: "/" <> name} = conn, opts) do
assign(conn, :name, the_name(name))
end
@todd
todd / mix.exs
Created April 25, 2016 02:32
Redis Keyevents -> RabbitMQ Messages
# mix.exs
defmodule RedisRabbitElixir.Mixfile do
use Mix.Project
def project do
[app: :redis_rabbit_elixir,
version: "0.0.1",
elixir: "~> 1.2",
build_embedded: Mix.env == :prod,