Skip to content

Instantly share code, notes, and snippets.

View noelworden's full-sized avatar

Noel Worden noelworden

View GitHub Profile
@noelworden
noelworden / test_envs_01.ex
Last active October 1, 2025 22:13
#blog_snippets
config :my_app, MyApp.Example,
api_key: env!("EXAMPLE_API_KEY", :string, ""),
hook_secret: env!("EXAMPLE_HOOK_SECRET", :string, ""),
verification_secret: env!("EXAMPLE_VERIFICATION_SECRET", :string, ""),
base_url: "https://myapp.api.example.com"
@noelworden
noelworden / test_envs_06.ex
Last active October 1, 2025 22:11
#blog_snippets
[other_secret: "original_secret"]
@noelworden
noelworden / test_envs_07.ex
Created October 1, 2025 22:10
#blog_snippets
defp set_other_secret(_) do
original_config = Application.get_env(:my_app, MyApp.Example)
hash = generate_fake_hash()
updated_config = Keyword.put(original_config, :other_secret, hash)
Application.put_env(:my_app, MyApp.Example, updated_config)
on_exit(fn ->
Application.put_env(:my_app, MyApp.Example, original_config)
end)
@noelworden
noelworden / test_envs_05.ex
Created October 1, 2025 22:07
#blog_snippets
Application.put_env(:my_app, MyApp.Example, other_secret: original_secret)
@noelworden
noelworden / test_envs_04.ex
Created October 1, 2025 22:07
#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}
@noelworden
noelworden / test_envs_03.ex
Created October 1, 2025 22:05
#blog_snippets
[other_secret: "original_secret"]
@noelworden
noelworden / test_envs_02.ex
Created October 1, 2025 21:36
#blog_snippets
@config Application.compile_env(:my_app, MyApp.Example)
@api_key @config[:api_key]
@base_url @config[:base_url]
@noelworden
noelworden / Standardized_Commits.md
Last active August 24, 2023 08:45
How to standardize git commit messages, #helpers
  • Why standardize messages? Its clean. Easy to see what changed and when. As an up-and-coming developer, my repos will probably be potential employers first impressions of me. Clean code (proper indentions/spacing etc) and formatted commit messages help show that I care about my code.

  • The workflow is to create a .txt file as a template, and configure git to use that file as the default message when commiting.

  • The key is the character count. Note the dashed lines representing 50 characters for the summary, and 72 for the description.

####implimentation####

  • cd ~ #to confirm in the home directory
@noelworden
noelworden / column_data10.ex
Last active April 26, 2023 07:03
#blog_snippets
defmodule Atlas.Mapping.CSVUtil do
@moduledoc """
Utility module to ingest `destination.csv`
"""
alias NimbleCSV.RFC4180, as: CSV
alias Atlas.{Mapping, Mapping.Destination, Repo}
def csv_row_to_table_record(file) do
column_names = get_column_names(file)
@noelworden
noelworden / prying_debugging.md
Last active February 18, 2021 22:08
#helpers