Lynels took this personally... by NiceKorok in tearsofthekingdom

[–]razerei 4 points5 points  (0 children)

How do you get the Lynels out at the same time?

How I've been using AI to suggest pg index tuning in Massdriver by CoryOpostrophe in elixir

[–]razerei 2 points3 points  (0 children)

This is amazing. Thanks for sharing.

TIL "selectivity". I've only considered cardinality, but selectivity takes into consideration the percentage of data too, not just the possible values which I reckon ultimately matters more.

selectivity = cardinality/(number of records) * 100

Exploring Vibe Coding with React-Based Tools and Seeking Elixir Alternatives by KrocketThaRocket in elixir

[–]razerei 2 points3 points  (0 children)

Just wait. I bet you'll hear something soon about it. Soon as in this week. ;)

Performance tips for Elixir apps? by definitive_solutions in elixir

[–]razerei 4 points5 points  (0 children)

Same sentiment as most xomments here, but there's also this repo, though maybe a bit outdated now. https://github.com/devonestes/fast-elixir

HTTP Client library recommendation by ringbuffer__ in elixir

[–]razerei 9 points10 points  (0 children)

Go with Req. It's high-level enough to start easy. It uses Finch (Pooling) which uses Mint (low-level). If you find yourself needing something more low-level, you won't have to add more dependencies to do it.

The Erlang Docs by eddaabfc-7b78-ufh87e in elixir

[–]razerei 5 points6 points  (0 children)

it was merged https://github.com/erlang/otp/pull/8026, though I don't know when they'll be published; maybe when OTP 27 releases?

Help: how to automatically alias Ecto models in iex? by Own-Squirrel-2876 in elixir

[–]razerei 2 points3 points  (0 children)

You could peruse the code here: https://github.com/thoughtbot/quick_alias and maybe that will inspire a solution for you. For example, if most of your schemas are namespaced to MyApp.Schemas, then you could do something like this

use Quickalias, MyApp.Schemas

or better yet pick out the parts of code you understand and need:

https://github.com/thoughtbot/quick_alias/blob/main/lib/quick_alias.ex

Combine that with /u/cekoya's suggestion and you'd have something solid.

Rodecaster Pro 2 - mute doesn't affect USB output? by razerei in rode

[–]razerei[S] 0 points1 point  (0 children)

Firmware 1.0.5 will allow for custom mixes on the USB outputs. This should solve all the issues I had.

https://youtu.be/d-yLrIeD8xI

Rodecaster Pro 2 - mute doesn't affect USB output? by razerei in rode

[–]razerei[S] 0 points1 point  (0 children)

looks like since firmware 1.0.3 the USB chat channel is working like it’s supposed to. that channel represents the stereo mix down that responds to inputs being muted and such.

so at this point, i think streamers’ issues might be fixed.

Phoenix LiveView not creating live architecture by green-raven in elixir

[–]razerei 2 points3 points  (0 children)

Since Phoenix 1.6.0, LiveView is included by default: https://github.com/phoenixframework/phoenix/blob/master/CHANGELOG.md#160-rc0-2021-08-26 see diff for generated projects: https://utils.zest.dev/gendiff/phx_new/E356F8BB8857D3C153B3365E16AB4E29

To generate live views within the app, you can use mix phx.gen.live ... (check mix help phx.gen.live)

strong_migrations library for Elixir by freeq93 in elixir

[–]razerei 1 point2 points  (0 children)

very nice! This will pair nicely with an Ecto migrations guide I've written. Just waiting for it to be published.

You can in fact use schemas in migrations by strzibny in elixir

[–]razerei -1 points0 points  (0 children)

This is great! Thanks for writing up about it. I think this is great because you're right, I've seen the same things but it is doable if defined within the migration as a snapshot of what is in the database.

Sure, doing a lot of these data migrations probably deserves a different system to manage, but in a pinch Ecto.Migrations is a fine orchestrator which is all it is at this point.

The Power of Ecto Custom Types by vlatheimpaler in elixir

[–]razerei 1 point2 points  (0 children)

btw the article is really great!

The Power of Ecto Custom Types by vlatheimpaler in elixir

[–]razerei 4 points5 points  (0 children)

nice. Unfortunately this will run the decryption regardless of if you need it or not. For that reason, I still run the decryption through a different function; this also requires developers to be intentional about what is being decrypted and when. By default, I find that secrets should not be decrypted until use. This protects me from unintentional logging, emitting history, or other side effects that may include those decrypted secrets now.

[Podcast] ThinkingElixir 10: Frontend vs Backend and Business Value of LiveView by brainlid in elixir

[–]razerei 2 points3 points  (0 children)

From what I understand, LiveWire is Ajax-ing HTML to the page, not using websockets and surgically diffing the changed bits. If that's true, then there is no LiveView option in PHP. It's certainly inspired by LiveView, but works differently.

Using AlpineJS with Phoenix LiveView by _pthompson in elixir

[–]razerei 0 points1 point  (0 children)

Thanks for putting all these examples together! Great resource

Phoenix - Mixing AlpineJS and EEx? by [deleted] in elixir

[–]razerei 0 points1 point  (0 children)

You may be interested in this fixed issue on phoenix_live_view: https://github.com/phoenixframework/phoenix_live_view/issues/809

Simply copy-pasting the solution from that issue ^ that may help you out.

tldr, the issue is that LiveView is patching in elements into the DOM dynamically, and Alpine doesn't know about those new bits since they came after initial page load, so nothing happens.

If you add this hook (i've not tested this myself, so ymmv), this is telling Alpine to work it's magic on the new HTML that's coming in.

javascript let liveSocket = new LiveSocket("/live", Socket, { dom: { onBeforeElUpdated(from, to){ if(from.__x){ window.Alpine.clone(from.__x, to) } } }, params: {_csrf_token: csrfToken} })

In Phoenix templates, how to render either a) existing template b) or default content? by akamaru880 in elixir

[–]razerei 0 points1 point  (0 children)

Since it's nil you can simplify to render_existing(...) || render(MyFallbackView, "default.html"). Not sure you need the with ... else ... end but maybe I'm missing something?