AstonJ

AstonJ

Share an Elixir or dev-env tip a day

..or as and when you can think of one :icon_cool:

This thread my also be of interest: What took you way too long to figure out? :003:

Most Liked

mudasobwa

mudasobwa

Creator of Cure
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/.

25
Post #6
hauleth

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.

14
Post #7
codeanpeace

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

Where Next?

Popular in Guides/Tuts Top

alejandroErik
POST IN CONSTRUCTION Process for compile erlang otp 20 with odbc-unix for Oracle connections on Solaris 11.3 for 64 bits: Introductio...
New
kokolegorille
Hello dear alchemists, There was this question some days ago here about the deployment to a VPS. As I was in the process of deploying t...
New
AstonJ
With a few questions relating to this recently, I wonder if it might help having a thread where we share how we’ve set up Elixir/Erlang/P...
New
bluegene
Hi guys, I’ve been on a personal journey to learn Elixir for the past two years. During this journey I’ve been using the spaced repetiti...
New
fuelen
Hi all! Just want to share a small code snippet which allows writing CASE expressions using macro which is similar to cond. Here is an ...
New
crockwave
To integrate dropdown menus in a Phoenix Liveview app, you can use a combination of js, Hooks, CSS and your .leex and .ex code. You can...
New
kevinlang
Hey all, With Phoenix 1.6 just around the corner, I figured I’d make a tutorial on how to add Bulma to a new Phoenix 1.6 project. By lev...
New
Morzaram
Hey guys I’ve made a guide on how to connect Quill to Phoenix. For the sake of formatting it might be easier to view it on my Notion Doc...
New
zachallaun
Hey friends, wanted to share a tiny shell script I’ve been using to start Livebook with easy access to either a running production server...
New
caspg
Hi everyone, I recently implemented a real-time search feature in a Phoenix application using LiveView and Tailwind, and I wanted to sha...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

We're in Beta

About us Mission Statement