Skip to content

Instantly share code, notes, and snippets.

Chris McCord chrismccord

Block or report user

Report or block chrismccord

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chrismccord
chrismccord / phx-1.4-upgrade.md
Last active Sep 12, 2019
Phoenix 1.3.x to 1.4.0 Upgrade Guides
View phx-1.4-upgrade.md

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 phx.new project generator

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

To grab the new archive, simply run:

@chrismccord
chrismccord / upgrade.md
Last active Sep 14, 2019
Phoenix 1.2.x to 1.3.0 Upgrade Instructions
View upgrade.md

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: https://www.youtube.com/watch?v=tMO28ar0lW8

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

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

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
chrismccord / install.sh
Created Jul 27, 2016 — forked from chaos-ad/install.sh
Installing erlang in ubuntu
View install.sh
#!/bin/bash
# installing erlang on ubuntu's
VERSION="R15B01"
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev
sudo mkdir -p /opt/erlang/
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl
sudo mv kerl /opt/erlang/
@chrismccord
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.
View upgrade.md

#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 https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Deps

@chrismccord
chrismccord / 1.js
Created Apr 7, 2016 — forked from net/1.js
Adding Bootstrap to Phoenix using NPM
View 1.js
// 1. Add Bootstrap as a dependency in package.json
{
...
"dependencies": {
...
"bootstrap": "~3.3.6"
}
}
View dynamic_dispatch.ex
# in your app supervisor
:phx_dyn_dispatch = :ets.new(:phx_dyn_dispatch, [:named_table, :bag, :public])
defmodule DynamicDispatch do
def register(group, plug, opts) do
true = :ets.insert(:phx_dyn_dispatch, {group, plug, opts})
end
def unregister(group, plug) do
@chrismccord
chrismccord / upgrade.md
Last active Jan 28, 2016
Phoenix 1.1.1 to 1.1.2 upgrade instructions
View upgrade.md

Phoenix 1.1.1 to 1.1.2 upgrade instructions

Optional upgrade for new brunch features

Update your phoenix deps

def deps do
  [{:phoenix, "~> 1.1.2"},
  ...]
end
@chrismccord
chrismccord / phoenix showdown rackspace onmetal io.md
Created Nov 17, 2015 — forked from omnibs/phoenix showdown rackspace onmetal io.md
Phoenix Showdown Comparative Benchmarks @ Rackspace
View phoenix showdown rackspace onmetal io.md

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@chrismccord
chrismccord / observer.md
Created Nov 3, 2015 — forked from pnc/observer.md
Using Erlang observer/appmon remotely
View observer.md

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
You can’t perform that action at this time.