AstonJ
Share an Elixir or dev-env tip a day
..or as and when you can think of one ![]()
This thread my also be of interest: What took you way too long to figure out? ![]()
Most Liked
mudasobwa
export ERL_AFLAGS='-kernel shell_history enabled -kernel shell_history_path \".erl.history\"'
The above makes iex sessions to store their history on a per-project basis in project directories. ,gitignore should be also updated to include /.erl.history/.
hauleth
I have already said it few times in different places, but do yourself a favour, and if you are using Git, then have globally (in ~/.config/git/attributes) or per project (in .gitattributes):
mix.lock merge=binary
This will make conflict resolution of mix.lock much easier.
Explanation
This will tell Git to treat Mix lock file as a binary file when doing merges/rebases. This mean, that if there is a conflict, there will be stop (so you need to resolve such conflict), but it will leave file as is (with no conflict markers). This makes my life much easier, as you can then just do mix deps.update --all (as it is most of the time source of such conflicts) and then just git add mix.lock && git rebase --continue.
codeanpeace
Handy way to pipe a result from within IEx to your macOS system clipboard when you have pbcopy installed and shell history enabled
defmodule Helpers do
# pipe expression result to clipboard e.g. ... |> Helpers.copy
def copy(term) do
text =
if is_binary(term) do
term
else
inspect(term, limit: :infinity, pretty: true)
end
port = Port.open({:spawn, "pbcopy"}, [])
true = Port.command(port, text)
true = Port.close(port)
IO.inspect(term, label: "copied to clipboard")
IEx.dont_display_result()
end
end
Popular in Guides/Tuts
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








