Skip to content

Instantly share code, notes, and snippets.

@noelworden
Created October 1, 2025 22:07
Show Gist options
  • Save noelworden/a98024526706d223c32de0f28332fa86 to your computer and use it in GitHub Desktop.
Save noelworden/a98024526706d223c32de0f28332fa86 to your computer and use it in GitHub Desktop.
#blog_snippets
defp set_other_secret(_) do
original_secret = Application.get_env(:my_app, MyApp.Example)[:other_secret]
hash = fake_hash()
Application.put_env(:my_app, MyApp.Example, other_secret: hash)
on_exit(fn ->
Application.put_env(:my_app, MyApp.Example, other_secret: original_secret)
end)
{:ok, other_secret: hash}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment