Skip to content

Instantly share code, notes, and snippets.

View zkayser's full-sized avatar
🎯

Zack Kayser zkayser

🎯
View GitHub Profile
@zkayser
zkayser / unverified_mocks.ex
Created April 17, 2024 13:06
Credo Check for Validating Mox Users Verify Expectations
defmodule MyApp.Checks.UnverifiedMocks do
@moduledoc """
#{__MODULE__} looks for test files that import Mox and use
the `expect/4` function, but do not enforce any assertions that
the expectations have been called or not either by running `verify_on_exit`
from a setup block or calling `verify!/0` or `verify!/1` inline
in a test block.
"""
@message """
@zkayser
zkayser / example.ex
Last active February 2, 2023 22:39
Leex/Heex
defmodule SearchLive do
.....STUFF
def render(assigns) do
template_extension = if FeatureFlag.enabled?(), do: ".heex", else: ".leex"
# I can't remember the exact API to directly render a template, but it's something like this:
Phoenix.View.render("search_live.html.#{template_extension}", assigns)
end
end

Keybase proof

I hereby claim:

  • I am zkayser on github.
  • I am zkayser (https://keybase.io/zkayser) on keybase.
  • I have a public key ASB67uwl1KYIkR4jhOOw1Kl-g0G5o_NGMo2qJimr_h3tjgo

To claim this, I am signing this object:

class Garden
attr_accessor :first_row, :second_row
attr_reader :names
CHARS_TO_PLANTS = {
"G" => :grass,
"C" => :clover,
"R" => :radishes,
"V" => :violets