Benjamin Milde

1.8K posts

Benjamin Milde banner
Benjamin Milde

Benjamin Milde

@lostkobrakai

Designer, Developer & Photographer

München Katılım Eylül 2009
285 Takip Edilen534 Takipçiler
Tyler A. Young ⚗️🧑🏻‍💻
#ElixirLang folks, is there a way to un-import a function? I have a third-party module that imports itself in its (required) `use`, but I'd like to replace one of the functions it imports.
English
5
0
8
1.6K
Benjamin Milde retweetledi
Sean Plott
Sean Plott@day9tv·
MY GAME STUDIO IS HIRING! We secured additional funding for our multiplayer PC strategy game and have openings for Lead Character Artist, Senior Animator, Senior Tools Engineer, and Senior AI Engineer (not ML/GenAI). Please retweet, ping friends, & tell all!!
Sean Plott tweet media
English
51
168
731
156.5K
Benjamin Milde retweetledi
Tyler A. Young ⚗️🧑🏻‍💻
Just merged our first PhoenixTest.Playwright test into main. Feels good! We get the wonderful PhoenixTest syntax (🙌 @germsvel) , but with the ability to execute JavaScript, all without the unreliability of Chromedriver. 😌 Shoutout to @aeftes for making this happen!
English
11
9
70
4K
Benjamin Milde
Benjamin Milde@lostkobrakai·
@_wilfredh Yeah, I‘d love if that would be the case for more specs. A language agnostic set of test cases makes it so much easier to build implementations for something. Tests can guide the implementation way before the implementer has a thorough understanding of the spec
English
0
0
0
97
Wilfred Hughes
Wilfred Hughes@_wilfredh·
I love how the CommonMark Spec has a test suite that's just a JSON array. It's really easy to test a library for compliance, and I've seen developers nerd-sniped into full compliance. spec.commonmark.org/0.31.2/spec.js…
English
2
0
12
1.3K
Benjamin Milde retweetledi
José Valim
José Valim@josevalim·
Elixir v1.18 is out: elixir-lang.org/blog/2024/12/1… 🎄🍾 It is a fantastic release: type checking of function calls, Language Server listeners, built-in JSON, ExUnit improvements, IEx auto-reload, and more. See the announcement for examples and videos.
English
18
171
726
40.4K
Dave Lucia
Dave Lucia@davydog187·
It was an honor and privilege to share the story of @tvlabs with Kris, especially given that Developer Voices is one of my favorite podcasts I hope you enjoy youtu.be/_MwXbHADT-A
YouTube video
YouTube
English
2
5
16
1.5K
Benjamin Milde
Benjamin Milde@lostkobrakai·
Today I published a first time video of mine talking about a concept I called "Behaviour Stacking" while working on it. kobrakai.de/videos/rwd3e If you ever wondered libraries like phoenix or bandit build features on top of OTP primitives work this is for you.
English
2
16
93
6.7K
philipbrown
philipbrown@philipbrown·
How are you managing multiple versions of Elixir + Erlang on macOS? I feel like there has to be better way than asdf.
English
15
0
3
1.5K
Benjamin Milde
Benjamin Milde@lostkobrakai·
@jskalc @elixirphoenix And that problem exists all throughout the stack. You could be configuring kernel or stdlib, which are the first apps to start on the beam, not just things in your app being developed.
English
1
0
1
100
Benjamin Milde
Benjamin Milde@lostkobrakai·
@jskalc @elixirphoenix Because it‘s simpler than expecting your app to be able to hot code reload all stateful processes, which might depend on the config changes. It‘s quite likely for apps to not support that. Like changing the port of your endpoint won‘t apply unless its process is restarted.
English
1
0
1
289
arvindpunk
arvindpunk@arvindpunk·
@josevalim I genuinely feel programming paired with realtime visual feedback is the way to go for beginners. @thecodingtrain's exceptional videos on p5.js are externally easy (and fun) to follow.
English
2
0
6
736
José Valim
José Valim@josevalim·
Any online courses/materials for a 10 year old who really wants to learn how to program? Either in english, polish, or portuguese? He already did a Scratch course and we are doing Lego SPIKE together on weekends. Maybe it is time for actually writing code? Suggestions?
English
40
3
127
15K
Anthony Accomazzo
Anthony Accomazzo@accomazzo·
We have a lot of Postgres tests at @sequinstream. Because we're testing things like the replication slot, we can't use @elixirlang Ecto sandboxes all the time. We need rows to commit and flow through the slot. We discovered a cool pattern for this in the Oban project – h/t @sorentwo! Why can't we use Ecto sandboxes? Ecto sandboxes wrap all your operations in a transaction. So, changes are not visible outside that transaction. Importantly for us, this means that changes are also not sent to the replication slot – the transaction has to commit first. Setup You can create a new repo just for test, `UnboxedRepo`. Ours lives in `test/support`. The UnboxedRepo, of course, doesn't use an Ecto sandbox in test. So you need to make sure that you clear unboxed tables before each test run. Start it in `test_helper.exs`: `Sequin.Test.UnboxedRepo.start_link()` Then you can purge tables in your `DataCase` `setup` block like so: ``` if tags[:unboxed] do Enum.each([Schema1, Schema2, Schema3], &UnboxedRepo.delete_all/1) end ``` Naturally, with this approach, you need to run unboxed tests with `async: false` and the `:unboxed` tag (more on future work here below). Schemas and factories Because we have a lot of tests that are inserting/updating/deleting rows, we have test tables that we use for this purpose. These tables belong to the `UnboxedRepo`'s migrations, so we only create them when `MIX_ENV=test`. We have tables to test different permutations that are possible in Postgres, for example a table without primary keys or a table with >1 PK. We also have full-blown Ecto schemas for each of these tables, which also live in `test/support`. And factories to complement them, so we can easily arrange tests. We can setup a situation with a database that has a table with no PKs and a few rows with a single line. Future work Most of our tests are async, and so we can run 528 tests in 5 seconds. It's fine for now that we have some `sync` tests, seems to barely make a difference. However, we have a couple of other clever ideas to provide ourselves a sandbox outside of Ecto's transactional sandbox model: 1. We could add a column to our test tables, like `test_pid`. Our tables are explicitly designed for test anyway. Then, we could ensure all writes include the `test_pid` and all reads include a filter for the `test_pid` (could use Process dictionary here). 2. We could use Postgres partitions to do isolation. Each test would then simply work inside its own partition. As always, you can check out the code in our repo: github.com/sequinstream/s… Just do a global search for `UnboxedRepo` to see all the pieces. Our test tables contain Dune characters, so you can search for eg `Character` to see an example of a table + schema + factory.
English
2
4
25
1.9K
Benjamin Milde retweetledi
Andriel Nuernberg
Andriel Nuernberg@andrielfn·
Quick LiveView tip that I used the other day: add "contents" class (display: contents) to the LiveView container - this way the "box" property goes directly to child elements #MyElixirStatus
Andriel Nuernberg tweet media
English
2
4
44
2.4K
Benjamin Milde retweetledi
Echo 🔆
Echo 🔆@TheEcho13·
There’s an app called ‘Paprika’. Download it. It costs a couple dollars but it’s worth it. Any time you find a recipe you like, you copy the URL, paste it into Paprika, and it will download the ingredients and directions and save it as a simple recipe card. You can curate an entire library of recipes and never have to wade through a web page again. You can scale the recipe to halve/double/etc it, you can change the units (metric/imperial), and you can check off ingredients as you use them so you know where you’re up too. It’ll change your life.
Echo 🔆 tweet mediaEcho 🔆 tweet media
English
259
1.5K
20.1K
1.6M
Benjamin Milde
Benjamin Milde@lostkobrakai·
@lawik Things are not as packed on my end, but certainly feeling similar atm xD
English
0
0
1
75
Lars Wikman
Lars Wikman@lawik·
Yes I deferred everything until after Code BEAM but why did all of it go on tuesday? 2-3 hours intense pairing (not originally planned) Podcast recording Hong Kong meetup presentation And in 90 min another podcast. I'm a dumbass. I will have no brain this evening.
English
2
1
4
753
Benjamin Milde retweetledi
Andrea Leopardi
Andrea Leopardi@whatyouhide·
So... my contract gigs will end in a few days. I’m now looking for a job! 🤓 - Principal engineer, backend/systems/arch focus - Fully remote, flexible hours (hard to find ppl in the same tz), pref async work - @elixirlang is def my strength, but I just love doing stuff
English
7
50
115
15K