Sign in

David Bernheisel

@david.bernheisel.com
1.2K followers 168 following 288 posts

erlef.org Board Member | Working at tv-labs | bernheisel.com | Founder of zest.dev (consultancy) #ElixirLang

PostsRepliesMedia
David Bernheisel @david.bernheisel.com · 17/07/2026
Added crt-lotte filter client side for beamicom_phx so it looks authentic
020
David Bernheisel @david.bernheisel.com · 17/07/2026
Check this out, this png is a save file. I don't know if bsky will re-encode it and lose the info, but around the border is encoded dots with the save state of the game. Load that in beamicom and pick up where you left off.
161
David Bernheisel @david.bernheisel.com · 16/07/2026
and now a WebRTC web client with AV1 encoding/relaying (with Membrane). Haven't deployed it yet, so not really "working" yet, but plays great locally right now. github.com/dbernheisel/...
050
David Bernheisel @david.bernheisel.com · 15/07/2026
gameplay (couldn't capture audio, but it's there)
161
David Bernheisel @david.bernheisel.com · 15/07/2026
oh hey, I wrote an NES emulator in Elixir 60fps (on my machine) with sound. This is Castlevania 3 which might be the toughest one to emulate. github.com/dbernheisel/... #ElixirLang
Castlevania 3 running in an Elixir-native NES emulator
1112825
David Bernheisel @david.bernheisel.com · 05/06/2026
Removed Dialyzer. Thank you Elixir 1.20.0 #ElixirLang
chore(ci): remove dialyzer
Merged by dbernheisel
merged 7 commits into mainfeels good meme man
3251
David Bernheisel @david.bernheisel.com · 17/04/2026
161
David Bernheisel @david.bernheisel.com · 15/04/2026
I always do this: `mix <tab> <tab> <rage tab>` and then realize completions aren't built in for mix. so I hacked together something truly awful, but it works github.com/dbernheisel/... Add this ^ to your zsh fpath and then you have more helpful completions, including flags. #ElixirLang
mix deps.unlock --unused
 -- switch --
--all           -- unlocks all dependencies
--check-unused  -- checks that the `mix.lock` file has no unused dependencies. This is useful in pre-commit hooks and CI sc
--filter        -- unlocks only deps matching the given name
--unused        -- unlocks only unused dependencies (no longer mentioned in the `mix.exs` file)
5164
David Bernheisel @david.bernheisel.com · 15/04/2026
I added a markdown pre-processor just for `nofile` markdown buffers. Renders with markview.nvim but pre-processed to reflow paragraphs, adjust spacing, and process md extensions. This shows a rendered info admonition block. 4-indented code in exdoc is assumed to be Elixir.
160
David Bernheisel @david.bernheisel.com · 13/04/2026
We have another one coming up called Runcom, which will be an infrastructure orchestration commander/dashboard. Imagine Ansible, but compiled, distributed, and commanded from your admin webapp. A little sneak peak for now
    |> Debug.add("start",
      message: &"Kitchen sink #{&1.assigns.run_id} starting"
    )
    |> RCFile.add("setup_dir",
      path: & &1.assigns.work_dir,
      state: :directory
    )
    |> Runcom.graft("probe", 
      RuncomDemo.Runbooks.AgentProbe.build(%{}), await: ["setup_dir"]
    )
    |> RCBash.add("sysinfo",
      script: ~BASH"uname -a",
      await: ["setup_dir"]
    )
    |> RCBash.add("disk",
      script: ~BASH"df -h / | tail -1",
      await: ["setup_dir"]
    )
120
David Bernheisel @david.bernheisel.com · 13/04/2026
I was able to wire up Popcorn to run Elixir and PGlite to run Postgres, both in the browser. This means we can have an interactive and safe sandbox for arbitrary code. Which means a really good experience learning Ecto on a website. I'll publish it soon :) #ElixirLang
25310
David Bernheisel @david.bernheisel.com · 28/02/2026
I build a Neovim blink.cmp source for Hex.pm. Now you can search hex packages from your mix.exs file, and autocomplete versions. github.com/dbernheisel/...
3295
David Bernheisel @david.bernheisel.com · 08/12/2025
Published a little LiveDashboard page for managing some data migrations. hex.pm/packages/dat... #ElixirLang
Example of LiveDashboard page with logs being streamed
1253
David Bernheisel @david.bernheisel.com · 15/08/2025
quick tip for #ElixirLang and HEEX HTML string attributes. Eg, when you need conditional css classes, use lists. LiveView will see it as an iolist. It lends itself to better formatting when it gets long, and you can logically group them. You don't need to interpolate a long string.
Much easier to read:

class={[
  # GOOD
  "block w-full rounded-md py-1.5 shadow-xs text-sm leading-6",
  "border-0 text-gray-900 ring-1 ring-inset ring-gray-300",
  "placeholder:text-gray-400  disabled:bg-slate-50 focus:ring-zinc-400",
  @errors != [] && "ring-rose-400 focus:ring-rose-400",
  @class
]}
Bad. See how hard this is to read?

class={"block w-full rounded-md py-1.5 shadow-xs text-sm leading-6 border-0 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400  disabled:bg-slate-50 focus:ring-zinc-400 #{@errors != [] && "ring-rose-400 focus:ring-rose-400"} #{@class}"}
1120
David Bernheisel @david.bernheisel.com · 17/02/2025
CSS `attr` now supports a type! this eliminates ugly hacks: - interpolating inline styling - tailwind helper functions avoiding interpolating part of a class name (though v4 resolve) - handling in JS developer.mozilla.org/en-US/docs/W... developer.chrome.com/blog/advance...
HTML

<div data-rotation="-3">I am
rotated
by -3 degrees</div>
<div data-rotation="2">And I by 2
degrees</div>
<div>And so am I, using the fallback value of 1.5deg</div>

CSS

div {
  width: fit-content;
  transform-origin: 50% 50%; 
  rotate: attr(data-rotation deg, 1.5deg);
}
090
David Bernheisel @david.bernheisel.com · 16/02/2025
Just want to know the opportunities! But yeah stateside is looking grim. Moving elsewhere in the country is also an option. Evidently we are "assessing the threats" of ADHD meds and SSRIs among others, which may code for "banning soon." www.whitehouse.gov/presidential...

THE WHITE HOUSE
Sec. 5. Initial Assessment and Strategy from the Make America Healthy Again Commission. (a) Make our Children Healthy Again Assessment. Within 100 days of the date of this order, the Commission shall submit to the President, through the Chair and the Executive Director, the Make Our Children Healthy Again Assessment, which shall:
(i) identify and describe childhood chronic disease in America compared to other countries;
(ii) assess the threat that potential over-utilization of medication, certain food ingredients, certain chemicals, and certain other exposures pose to children with respect to chronic inflammation or other established mechanisms of disease, using rigorous and transparent data, including international comparisons;
(ill) assess the prevalence of and threat posed by the prescription of selective serotonin reuptake inhibitors, antipsychotics, mood stabilizers, stimulants, and weight-loss drugs;|
110
David Bernheisel @david.bernheisel.com · 07/02/2025
Holy smokes this is awesome, a new debugger for Phoenix LiveView. Think React devtools, but not a chrome extension. github.com/software-man... #ElixirLang
515040
David Bernheisel @david.bernheisel.com · 16/01/2025
It also has some simplified igniter-powered installation scripts. It's super simple now to add Oban to your existing project or start a new Phoenix project with Oban included. Lastly, a lot of improvements in the UI, telemetry, simplification of how to mount the dashboard hexdocs.pm/igniter/read...
mix archive.install hex igniter_new

mix igniter.new oban_demo \
  --with phx.new \
  --with-args="--database postgres" \
  --install oban
020
David Bernheisel @david.bernheisel.com · 14/01/2025
@nezteb.net the Elixir feed doesn't seem to be working. Is the provider of it down? iirc it was skyfeed, right?
Status page of skyfees indicating all the things are down
110
David Bernheisel @david.bernheisel.com · 10/01/2025
AWESOME! Coming in ex_doc soon is a new button to go to the latest version's documentation if you happen to be on an earlier version. I often find myself googling something, getting a hexdocs.pm link but for some inexplicable reason it puts me into an old version of it github.com/elixir-lang/...
screenshot of hexdocs for req that contains a link to go to the latest version of the documentation.
4606
David Bernheisel @david.bernheisel.com · 28/12/2024
Elixir 1.19 lands some new type checking, this time with protocols! If you implement a pattern-match inside of a protocol implementation that isn't possible, the compiler will now warn! It was also warn if you implement for an unknown (eg, misspelled) module. #ElixirLang
defprotocol UnknownImplFor do
  def foo(data)
end

defimpl UnknownImplFor,
  for: [
    Map,
    # Unknown # <-- This is the problem
  ] do
  def foo(data), do: data
end

# Compiling 1 file (.ex)
#     warning: you are implementing a protocol for Unknown
#     but said module is not available. Make sure the module
#     name is correct. If Unknown is an optional dependency,
#     please wrap the protocol implementation in a
#     Code.ensure_loaded?(Unknown) check
#     │
#   5 │ defimpl UnknownImplFor,
#     │ ~~~~~~~~~~~~~~~~~~~~~~~
#     │
#     └─ lib/protocol_types.ex:5: (file)
defprotocol IncorrectImpl do
  def foo(data)
end

defimpl IncorrectImpl, for: [Map, Range, Bitstring] do
  def foo(nil), do: nil  # <--- This is the problem
  def foo(map), do: map
end

# Compiling 2 files (.ex)
#     warning: the 1st pattern in clause will never match:
#
#         nil
#
#     because it is expected to receive type:
#
#         dynamic(%Range{first: term(), last: term(), step: term()})
#
#     typing violation found at:
#     │
#   6 │   def foo(nil), do: nil
#     │   ~~~~~~~~~~~~~~~~~~~~~
#     │
#     └─ lib/incorrect_dispatch.ex:6: IncorrectDispatch.Range.foo/1
47715
David Bernheisel @david.bernheisel.com · 26/11/2024
Set him up for success with stories about "this is how you remind me of what I am really am" and how you "never made it as a wise man" then tell him to look at this photograph
Dave's favorite band Nickelback singer holding a photo of Dave
011
David Bernheisel @david.bernheisel.com · 15/11/2024
#CodeBEAM #ElixirLang Carlo sharing how to break down problems, organize the chaos, and visualize the interacting components
Carlo Gilmar on stage with a slide of visual thinking practices
070
David Bernheisel @david.bernheisel.com · 15/11/2024
#ElixirLang #CodeBEAM Sergey is showing how to leverage mix for erlang projects
Sergey on stageA comparison of erlang rebar config and its equivalent mix config.
1121
David Bernheisel @david.bernheisel.com · 15/11/2024
#ElixirLang #CodeBEAM awesome presentation on telemetry with Live View Dead Views, async OTP tasks, linked async jobs, and frontend (oh my)
Slide asking Can we combine or link traces for dead render and live render? Answer: yes.
030
David Bernheisel @david.bernheisel.com · 15/11/2024
010
David Bernheisel @david.bernheisel.com · 15/11/2024
Turns out SonicPI is fundamentally sound in theory as well as literally sound.
Slide showing theory
110
David Bernheisel @david.bernheisel.com · 15/11/2024
#ElixirLang #CodeBEAM @samaaron.bsky.social is introducing his new thing Tau5. Education through music. Incredibly engaging.
Sam Aaron on stage with a slideshow behind him providing background on his software Sonic PI
192
David Bernheisel @david.bernheisel.com · 15/11/2024
I have arrived! Great friends! Cannot wait for all the awesome talks and convos #ElixirLang
CodeBEAM stage in NYC
0110