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:

First Post!

AstonJ

AstonJ

I accidentally pasted my banking password into Terminal, so wanted to delete it to be on the safe side!

# close the app, then: 
rm ~/.zsh_history
rm -rf ~/.zsh_sessions

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 #5
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 #6
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

Last Post!

bunnylushington

bunnylushington

The atuin shell history manager has various ways of grouping shell history. I find the “workspace” option particularly useful.

Where Next?

Popular in Guides/Tuts Top

dennisreimann
I wrote a guide for implementing Passwordless Authentication a.k.a. “Magic Login Links”: https://dennisreimann.de/articles/phoenix-passw...
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
Logan
Here is an example of a Mix application that utilizes Cowboy to handle websocket connections. If anyone has an idea about making this wor...
New
magnetic
Hey :waving_hand:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and ...
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
hauks96
Hello everyone, I created a deployment tutorial for Phoenix applications with Kubernetes (microk8s) a few months back with the goal of s...
New
tonydang
I recently got inertia-phoenix (an Inertia.js adapter for Phoenix) working with Svelte. Setting up the server-side rendering (SSR) with S...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement