How To Build Docker Containers For Elixir Apps
A complete guide for building Docker Containers for Elixir application deployment. Bonus content: A boilerplate Dockerfile that you can use for all Elixir (and Phoenix) applications.
https://medium.com/@pentacent/getting-started-with-elixir-docker-982e2a16213c
plymio_ast v1.0.0
Just published v1.0.0 of my plymio_ast package.
New version because there are breaking changes. Full details in the Changelog.
I have adopted also an API that returns either {:ok, value} or {:error, error}` where error will be an Exception.
plymio_option v0.2.0
Just published the latest release of my plymio_option package.
The package offers a potpourri of utility functions for managing Keyword options.
Main change is I have adopted an API that returns either or {:error, error}` where error will be an Exception.
Elixir with Love
Here’s my short recap from the Elixir with Love conference last week. With a mix of great talks about technology and community, I left the event excited about the future of Elixir. https://blog.echobind.com/elixir-with-love-f1fe5e9a1f2
Building a Static Site with Elixir
Our latest episode is live. In it we see what it takes to build a static site with Elixir.
Watch it here: https://elixircasts.io/static-site-with-elixir
Do you miss `User.create(params)`? Try BaseModel, ActiveRecord for Ecto.
Db.Repo.all(from c in Comment, where: c.post_id == ^post_id)
Ecto has always seemed more verbose, and harder to read than it needs to be. I’d rather write:
Comment.where(post: post)
Don’t want to write CRUD for every model? Let BaseModel write it for you: add use BaseModel, repo: MyApp.Repo
to the top of your models, and immediately gain a fluent API for your data:
-
create(params)
-
all
-
find(id)
-
first(where_clause)
-
first_or_create(where_clause)
-
where(where_clause)
-
count(where_clause \\ [])
-
update(struct, params)
-
update_where(where_clause, params)
-
delete(id_or_struct)
-
delete_where(where_clause)
-
delete_all
BaseModel resolves associations automatically, supports Ecto validations, saves lots of keystrokes on the console while developing and debugging, and encourages good separation of persistence code from the rest of your app.
Check it out on Github.
How to automatically run stale tests on file change in Elixir
Short blog article with script to automatically run stale tests whenever file is changed https://medium.com/@andrew_dryga/run-stale-tests-on-file-change-in-elixir-6f8aac829973
Introducing phxsockets.io
I wanted to share with you a small project that I have been working on for the last weeks.
It is a small tool for assisting you while developing or testing Phoenix sockets and channels, or in other words, a minified version of the famous Postman app but for Phoenix WebSockets.
It is still under development, and I am planning to add some cool features, so suggestions and feedback are very welcome :)
Happy coding!
A package with some extra phoenix generators
I often want to quickly create a controller or view, not necessarily tied to an entire context/model.
Right now I copy an existing controller/view, and strip it down to a new one. These generators look pretty small, but imo it would be a great workflow improvement to be able to generate these from the command line.
There wasn’t any interest in maintaining this in Phoenix itself, so I made a little package with controller and view generators. Might expand later!
https://github.com/sebastiandedeyne/phoenix_extra_generators
A short overview of Elixir executables with escripts
A short intro to escripts
, what they are, how they integrate with mix and why you should avoid using archives.
https://monades.roperzh.com/overview-elixir-executables-escripts/
@rrrene joins @spawnfest's jury :)
What a better place to share this news than here, right? Thanks @rrrene for joining us on https://spawnfest.github.io/judges
Automatic Bang! Function Generation in Elixir
I just published unsafe which aids in generation of bang functions based on easy module attributes.
Short blog post here, if you feel like reading why: https://whitfin.io/generating-bang-functions-in-elixir/
assert_value - ExUnit's assert on steroids that writes and updates tests for you
We are releasing assert_value. assert_value is ExUnit’s assert on steroids that writes and updates tests for you.
You can use assert_value instead of ExUnit’s assert. It makes Elixir tests interactive and lets you to create and update expected values with a single key press.
json_stream_encoder v0.1.1
I’ve published a new version of json_stream_encoder with updated (less typo-ridden) documentation.
If you are looking for a way to stream out JSON incrementally without fitting the whole data structure in memory, check out the source.
IntelliJ Elixir v6.5.1
-
Fix
MockProjectEx
being a runtime dependency instead of just a test dependency.
ExUnit Quick Reference
ExUnit is the testing framework that ships with Elixir. I wrote a quick reference guide for our team and wanted to share with anyone else that found it helpful.
https://littlelines.com/blog/2017/11/06/exunit-quick-reference
Cheers!
Nerves Project Update and Training Schedule
See what the Nerves team has been working on recently and where you can learn more at upcoming training events - http://embedded-elixir.com/post/2017-11-02-nerves-update/
IntelliJ Elixir v6.5.0
-
Elixir 1.5 grammar
-
not in
-
Precedence of
@numeric
and unary numeric prefix operators
-
-
Make binary infix vs unary prefix
+
/-
handling more robust to supportone(two, - three)
-
Call
withCharSet(Charsets.UTF_8)
on allGeneralCommandLines
to prevent encoding errors on Windows.
Live coded chat app in 45 minutes
http://crowdhailer.me/talks/2017-10-31/live-coded-chat-app-in-45-minutes/
Several important areas for Elixir development today are covered. Using Docker for local development as well production deployment. Managing configuration for multiple services. Testing and documenting APIs.
Authex - a simple JWT alternative.
Many of our app API’s use the same process for JWT authentication and authorization. I finally had time to extract things into releasable libraries. A simple alternative to some of the other options available out there. Includes authentication, authorization, as well as blacklisting.
Hope someone can find it useful.