Skip to content

Instantly share code, notes, and snippets.

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 /
Created Oct 6, 2015 — forked from eoinkelly/
Upgrade Postgres to 9.4 using Homebrew on Mac OSX
# This script can be used in "run & hope" mode or you can use it as a recipe to
# do things manually - you probably want the latter if you really care about
# the data in your databases.
# Happy hacking
# /Eoin/
# Tell bash to stop if something goes wrong
set -e
View document_channel.ex
broadcast! socket, "insert_img", %{
url: url,
start: params["start"],
end: params["end"]
View catch_all_action.ex
defmodule MyApp.Web do
def controller do
quote do
use Phoenix.Controller
use MyApp.CatchAllController
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"},
chrismccord /
Last active Aug 29, 2015
Phoenix 0.15.x to 0.16.0 upgrade instructions

Phoenix dep

Update your phoenix dep:

def deps do
  {:phoenix, "~> 0.16"},
chrismccord /
Last active Aug 29, 2015
Phoenix upgrade instructions 0.14.x to 0.15.0

Sockets and Channels

A new socket behaviour has been introduced to handle socket authentication in a single place, wire up default channel assigns, and disconnect a user's multiplex connection as needed.

First things first, create a UserSocket module in web/channels/user_socket.ex and move all your channel routes from web/route.ex to the user socket: (replace MyApp with your application module)

0.14.x - web/router.ex:

defmodule MyApp.Router do
chrismccord / gist:57805158f463d3369103
Last active Feb 12, 2016
Phoenix Upgrade Instructions 0.13.x 0.14.0
View gist:57805158f463d3369103

First, bump your phoenix in mix.exs:

def deps do
  [{:phoenix, "~> 0.14"}, ...


Update your phoenix_html version to 1.1.0 in mix.exs:

View gist:b662bd26f68fa10b6651
defmodule MyApp.Password do
@moduledoc """
Handles password authentication, encryption, and decryption
@doc """
Encrypte the password String
def encrypt(raw_password) do
View gist:316400191d50278c3fed
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"