Skip to content

Instantly share code, notes, and snippets.

chrismccord /
Last active Jun 24, 2022
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote:

To use the new project generator, you can install the archive with the following command:

$ mix archive.install

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

chrismccord / gist:ee5ae90b949a9768b871
Last active Feb 17, 2022
Phoenix 0.16.x to 0.17.0 upgrade instructions
View gist:ee5ae90b949a9768b871


Bump your :phoenix and :phoenix_live_reload deps in mix.exs:

def deps do
   {:phoenix, "~> 0.17"},
   {:phoenix_live_reload, "~> 1.0"},

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
chrismccord /
Last active Jan 6, 2022
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new project generator

The mix archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

chrismccord /
Created Nov 3, 2015 — forked from pnc/
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
chrismccord / drain_stop.ex
Created May 27, 2016 — forked from aaronjensen/drain_stop.ex
Phoenix Drain Stop
View drain_stop.ex
defmodule DrainStop do
@moduledoc """
DrainStop Attempts to gracefully shutdown an endpoint when a normal shutdown
occurs. It first shuts down the acceptor, ensuring that no new requests can be
made. It then waits for all pending requests to complete. If the timeout
expires before this happens, it stops waiting, allowing the supervision tree
to continue its shutdown order.
DrainStop should be installed in your supervision tree *after* the
EndPoint it is going to drain stop.
chrismccord / gist:31340f08d62de1457454
Last active Aug 8, 2021
Phoenix Content Negotiation
View gist:31340f08d62de1457454
# Controller option 1, implicit render selected based on format
defmodule MyApp.UserController do
use Phoenix.Controller
def show(conn, %{"id" => id}) do
render conn, :show, user: Repo.get(User, id)
# Controller option 2, explicit render with format pattern match
chrismccord / gist:6723644
Created Sep 27, 2013
zsh vi mode status
View gist:6723644
function zle-keymap-select {
zle reset-prompt
zle -N zle-keymap-select
chrismccord /
Created Jul 27, 2016 — forked from chaos-ad/
Installing erlang in ubuntu
# installing erlang on ubuntu's
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev
sudo mkdir -p /opt/erlang/
curl -O && chmod a+x kerl
sudo mv kerl /opt/erlang/

#Phoenix 1.1.x to 1.2.0 Upgrade Instructions

Project Generator

To generate new projects as 1.2.0, install the new mix archive:

mix archive.install