Elixir Blog Posts

By accident found this while reading the overall good articles at http://no-kill-switch.ghost.io

3 Likes

Designing a P2P Lending platform with Elixir in mind

3 Likes

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

2 Likes

In the internal terminal of visual studio code one can also simply cmd + click the path in the terminal to open the migration :slight_smile:

1 Like

Clustering your Elixir application on AWS inside an Auto Scaling Group

https://blog.pryin.io/clustering-your-elixir-app-in-aws-auto-scaling-group/

1 Like

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 :slight_smile:

Also :point_up: :wave: @manukall

7 Likes

Iā€™ve been having similar thoughts recently :023:

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 :slight_smile:

3 Likes

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!

11 Likes

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!

7 Likes


3 Likes

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)ā€¦ >.>

1 Like

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/

3 Likes
5 Likes

https://ericdouglas.github.io/2017/08/24/practicing-the-elixir-language/

2 Likes

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ā€¦ :slight_smile:

http://fredwu.me/post/164668682508/coding-and-learning-should-never-stop-open

2 Likes
2 Likes

10 Killer Elixir Tips #6

Highlight
Execution with demos

2 Likes