Skip to content

Instantly share code, notes, and snippets.

@sorentwo
sorentwo / mailer.ex
Created February 11, 2016 19:17
Bamboo.Mailer as a genserver
defmacro __using__(opts) do
quote bind_quoted: [opts: opts] do
%{adapter: adapter, config: config} = Bamboo.Mailer.parse_opts(__MODULE__, opts)
@adapter adapter
@config config
end
end
def start_link(opts \\ []) do
@troyericg
troyericg / git-merge-strategies
Created October 16, 2014 16:08
(Because I always forget) How to overwrite a master branch with a remote branch
git checkout better_branch
git merge --strategy=ours master # keep the content of this branch, but record a merge
git checkout master
git merge better_branch # fast-forward master up to the merge
----------------------
If you want your history to be a little clearer, I'd recommend adding some information to the merge commit message to make it clear what you've done. Change the second line to:
@joakimk
joakimk / README.md
Last active January 1, 2022 23:21
CircleCI elixir build example

This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.

We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.

It should be generic enough to work on any elixir app using mix.

If you have a elixir_buildpack.config, then enable that section in the build script to keep versions in sync!

2016-08-09: Updated to newer Erlang and Elixir and fixed curl command.