Alpine: 3.4 Elixir: 1.3.4 Erlang: R18
linux-headers erlang-snmp
defmodule Appsignal.Plug.JSExceptionCatcher do | |
@behaviour Plug | |
import Plug.Conn | |
alias Appsignal.Transaction | |
@defaults [ | |
path: "/appsignal_error_catcher", | |
namespace: :frontend | |
] |
defmodule Twin do | |
@moduledoc """ | |
See http://teamon.eu/2017/different-approach-to-elixir-mocks-doubles/ | |
Example usage | |
defmodule MyApp.Main do | |
@api Twin.get(MyApp.Api) | |
def run do |
#!/bin/bash | |
set -e | |
VERSION="1" | |
IMAGE="hello/simple" | |
_run(){ | |
echo "----> $@" | |
$@ |
defmodule Double do | |
@moduledoc """ | |
See http://teamon.eu/2017/different-approach-to-elixir-mocks-doubles/ | |
""" | |
## GEN SERVER | |
use GenServer | |
## CLIENT API |
defmodule Recruitee.Repo do | |
use Ecto.Repo, otp_app: :recruitee | |
import Ecto.Query | |
@doc """ | |
Stream query results | |
Example: | |
iex> Candidate | |
...> |> where([c], c.foo > 4) |
defmodule Sync.Middleware.RateLimit do | |
@defaults [ | |
delay: 2000, | |
max_retries: 5 | |
] | |
def call(env, next, opts) do | |
opts = opts || [] | |
delay = Keyword.get(opts, :delay, @defaults[:delay]) | |
max_retries = Keyword.get(opts, :max_retries, @defaults[:max_retries]) |
# ~/.gitconfig | |
[core] | |
excludesfile = /Users/[YOUR USER NAME]/.gitignore_global |
# Much simplified version based on https://github.com/zhangsoledad/alchemic_avatar | |
# Avatar.generate/2 returns a Plug.Upload that can be passed directly | |
# into Ecto.Changeset (as for example fallback image) | |
defmodule Avatar do | |
@defaults [ | |
size: 300, | |
font_path: Application.app_dir(:my_app, "priv/fonts/Roboto.ttf"), | |
font_size: 40, | |
font_weight: 500, |