By accident found this while reading the overall good articles at http://no-kill-switch.ghost.io
Designing a P2P Lending platform with Elixir in mind
Open your text editor with the migration file when you run mix ecto.gen.migration: https://goodcode.in/ecto/1/open-your-text-editor-with-the-migration-file-when-you-run-mix-ecto-gen-migration
In the internal terminal of visual studio code one can also simply cmd + click the path in the terminal to open the migration
Clustering your Elixir application on AWS inside an Auto Scaling Group
https://blog.pryin.io/clustering-your-elixir-app-in-aws-auto-scaling-group/
Choosing Elixir for the Code, not the Performance - mainly thoughts about how often performance, scalability etc. is praised as what makes elixir great but thereās just so much more and even arguably more important
Also @manukall
Iāve been having similar thoughts recently
Elixir is introducing and making easy so many fantastic ābest practicesā which have been slowly answering my burning curiosity of āsurely there is a better way of developing???ā that I frequently had when I was using Rails.
Things like easily being able to build your app as a series of components, or preferring not to use if/elseās (and multiple function defs with pattern matching instead) meaning functions do one thing
I blogged again: āConfiguring Elixir Librariesā. This extends my series on designing libraries for Elixir. So far thereās just one more post: āError Handling in Elixir Librariesā.
If you have some suggestions on other topics I could cover there, Iām open to suggestions!
Iād be interested in reading about how to make a library reusable. As per the Ecto repository pattern where you use Ecto.Repo
in your own module to allow multiple repositories in a single Elixir application. To also cover how best to supervise processes, and their naming conventions.
So thereās a few blog posts about Elixir on our blog at www.amberbit.com/blog that I wasnāt posting here and you may like:
Enjoy!
Really cool!!
Accessing priv directory
You probably have some migrations and other stuff inside /priv directory, to access it use Application.app_dir(app, [āprivā]) in your Elixir code and OTP machinery would make sure you wonāt loose files inside of it.
Ugh, no!
To get the priv directory always use only :code.priv_dir(:my_app_name)
! Though āmostā of the time priv
will be in the appās directory, it ācouldā also be elsewhere, renamed, and variety of other things, and as such this will break in certain situations (like, say, running from inside a tar file or so)ā¦ >.>
Application.app_dir
does exactly the same :code.priv_dir
does minus appending of the priv
part. There is no difference between them.
There is last I saw. Last I checked Application.app_dir/2
calls :code.lib_dir(:app)
, which returns the path to the app library directory (which might be a tar file for example, but without the extension), and then it uses Path.join/2
to append it. Where calling :code.lib_dir(:app)
instead queries the :code_server
directly, which then properly puts the path on to the end of the lib_path, using something similar to Path.join when it is a path, or doing something āelseā when it is a packaged file (like a tar file). In addition some custom BEAM builds use a priv directory located and named elsewhere for embedded systems (admittedly this was a decade ago).
Well I just wrote a summary of the Elixir.LDN conference https://zorbash.com/post/elixirldn-2017/
But I think folks might also find this post about Docker multi-stage Distillery releases useful. https://zorbash.com/post/docker-multi-stage-elixir-distillery-releases/
Iāve had a productive coding weekend, and so I decided to share my experience. In the past month or so I built two more open source libraries, and contributed to a couple tooā¦
http://fredwu.me/post/164668682508/coding-and-learning-should-never-stop-open
10 Killer Elixir Tips #6
Highlight
Execution with demos