Elixir Wizards S5E12 Brian Howenstein on How ClusterTruck is Innovating Food Delivery
Latest episode of Elixir Wizards is out today! Check it out here: https://smartlogic.io/podcast/elixir-wizards/s5e12-howenstein/
How to use Ecto's Repo.stream/1 to process large amounts of data
It’s great to have tools like Flow, GenStage, or Broadway, but you don’t always need them! This short post shows a really easy way to process large-ish (max few hours of processing) datasets using Ecto’s Repo.stream/1.
https://mkaszubowski.com/2021/02/16/ecto-repo-stream-data-processing.html
Dynamic Nested Function Call with Macro
Blogged on how to build a nested dynamic function call like
foo(:bar, fn arg1 ->
foo(:baz, fn arg2 ->
...
foo(:bzz, fn argN ->
{arg1, arg2, ..., argN}
end)
...
end)
end)
https://rocket-science.ru/hacking/2021/02/18/dynamic-nested-function-calls-with-macro
Cursed curried Elixir
If you love currying and think macros are scary, this post is for you! https://liftm.io/posts/cursed-curried-elixir.html
Handling configuration variables in Elixir
We have some environmental variables in almost every Elixir application. They change the behavior of the system. They even allow you to reduce variables hard-coded somewhere in the depths of the code.
Check how to handle it better: https://bartoszgorka.com/handling-configuration-variables-in-elixir
ThinkingElixir 035: X-Plane's Elixir MMO with Tyler Young
In episode 35 of Thinking Elixir, Tyler Young from X-Plane talks with us about how he added a new MMO feature to the popular flight simulator using Elixir. He shares some behind the scenes information on how it was created and how it’s been working in production. We learn about the single modest server that supports all the mobile users right now.
I loved hearing how Tyler found working with Elixir to be super productive. He took on a major new feature that he expected to take over a year but was able to deliver it in less than half the time. He did all the Elixir work himself and was new to it!
ecto_psql_extras: "null_indexes" method added
https://github.com/pawurb/ecto_psql_extras#null_indexes New release of EctoPSQLExtras library introduces a “null_indexes” method. It allows you to track indexes that contain mostly NULL values and can probably be changed to partial index to improve insert performance and reduce disk usage
Conditional context for macros
Blogged on how to use __CALLER__.context and __CALLER__.context_modules to build macros, which behaviour depends on the context (different/extended abilities when in guard, when in match, elsewhere.)
https://rocket-science.ru/hacking/2021/02/13/conditional-context
Database Session Store with Elixir and Plug
Writing your first encrypted DB-backed session store with sliding timeout
https://kimlindholm.medium.com/database-session-store-with-elixir-and-plug-4354740e2f58
The case of the Red Bug (tracing in Elixir)
I’ve been exploring a bit tracing in Elixir as I needed an API endpoint returning a trace of all function calls when certain module is invoked. Most of the time tracing tools output to stdout but I needed something that I can use for API. This blog post is a short story-like description how I did it.
Building a Real-time Kanban Board with Phoenix LiveView
I’ve started building a very simple Kanban board web app to try out Phoenix LiveView, and got pretty excited with the feature - so I decided to write a small tutorial on how to build it :)
https://medium.com/@leo_hetsch/building-a-real-time-kanban-board-with-phoenix-liveview-e9b718ac185
Open sourced a website, blog and more. Merry Christmas!
I decided to make it open source because someone else might benefit from the work i have done over the years even though, at times, some functionality might not have the perfect implementation, so take it as it is if you want :)
Most features have an equivalent admin space where things can be configured…
Conditional guard for structs of an explicit type
Blogged on how to conditionally define a guard to check if the argument is a particular struct, so that it works with previous versions of Elixir / OTP.
→ https://rocket-science.ru/hacking/2021/02/12/conditional-defguard
Elixir Wizards S5E11 Yair Flicker on SmartLogic’s Origin, Evolution, and Elixir Adoption Process
Latest episode of Elixir Wizards is out today! Check it out here: https://smartlogic.io/podcast/elixir-wizards/s5e11-flicker/
IntellIJ Elixir v11.10.0
Changelog
Enhancements
-
Simplify
onlyTemplateDateFileType -
Add missing opcodes to
Codedisassembler-
OTP 23 opcode
bs_start_match4 -
Current (in-development) OTP 24 opcodes
-
make_fun3 -
init_yregs -
recv_marker_bind -
recv_marker_clear -
recv_marker_clear -
recv_marker_user
-
-
OTP 23 opcode
-
Log
PsiElementifCall#finalArgumentscontain anull. -
Suggest ASDF directories as
homepaths for both Elixir and Erlang for Elixir SDKs. -
Run ‘Dialyzer based inspections (Elixir)’ using Elixir SDK running
mix dialyzeror any customizedmixcommand.
Bug Fixes
-
Use
VirtualFile#fileTypeinstead of EEx Type::INSTANCE when looking up extensions. Since LEEx fileTypeis a subclass of EEx’s fileType, it callstemplateDataFileTypeSetin EEx’sType, buttemplateDataFileTypeSetusesINSTANCEfrom EEx. By using theVirtualFile#fileTypeinstead, it will properly be EEx or LEEx based on the actual file extension and then it can be used to strip that off and find the DataTemplateLanguage, such asHTMLLanguagefor.html.leex. -
Compare max opcode in to file to max opcode number, not ordinal.
Opcodes are 1-based, but the ordinal of the Kotlin
Enums are 0-based, so the comparison was off-by-1 when a file had the max opcode and would be incorrectly marked as too new. -
Don’t return null left or right infix operands in
primaryArgumentsoperation.infix.Normalized.leftOperandand.rightOperandensures thatPsiErrorElementis not returned: they can returnnullwhen there is no left or right operand.Infix.primaryArgumentswas not taking this into account and so could return anullas one of theprimaryArguments, which brokeCall.finalArguments. -
Don’t attempt to execute
elixir -e “System.version |> IO.puts”to get the version number as it requires too much of a full SDK to be built and from the Erlang paths to be correct too, which was rarely the case for ASDF. Since for Homebrew and ASDF, the directory name is the version name, this shouldn’t be a loss in naming ability. If the directory name is not a parseable version it will be of the formatElixir at <path>. This is probably more correct for installs directories that aren’t versioned as SDK versions aren’t updated if the version installed at the path changes, such as/usr/local/elixiror/opt/elixir, etc.
Elixir Wizards Livestream: Brewing a Love Potion 2/12
This Friday! Another Elixir Wizards live stream, with many special guests. Join us from 11AM-1PM EST at https://www.twitch.tv/smartlogictv
ThinkingElixir 034: José Valim reveals Project Nx
In episode 34 of Thinking Elixir, José Valim visits and finally publicly reveals what Project Nx is. He and others have been working on it for 3 months and he’s finally ready to unveil it. José will speak more about it at the LambdaDays conference, demonstrating it with code and announcing the release and availability of the OpenSource code. This is an exciting development that brings Elixir into areas it hasn’t been used before. We also talk about what this means for Elixir and the community going forward. A must listen!
Still: A Composable Elixir Static Site Generator
Use Elixir everywhere and anywhere. Presenting Still, a composable Elixir Static Site Generator. https://stillstatic.io
PKCS#5 algorithms in Erlang
https://github.com/exograd/erl-pkcs5
Erlang implementation of PBKDF2 algorithm defined by the RFC 8018.
