Skip to content

Instantly share code, notes, and snippets.

@chrismccord
chrismccord / phoenix showdown rackspace onmetal io.md
Created November 17, 2015 14:58 — forked from omnibs/phoenix showdown rackspace onmetal io.md
Phoenix Showdown Comparative Benchmarks @ Rackspace

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 November 3, 2015 21:29 — forked from pnc/observer.md
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
chrismccord / postgres-upgrade-recipe.sh
Created October 6, 2015 11:14 — forked from eoinkelly/postgres-upgrade-recipe.sh
Upgrade Postgres to 9.4 using Homebrew on Mac OSX
#!/bin/bash
# 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
broadcast! socket, "insert_img", %{
url: url,
start: params["start"],
end: params["end"]
}
@chrismccord
chrismccord / catch_all_action.ex
Created September 18, 2015 00:06
catch-all action
defmodule MyApp.Web do
def controller do
quote do
use Phoenix.Controller
use MyApp.CatchAllController
...
end
end
end
@chrismccord
chrismccord / gist:ee5ae90b949a9768b871
Last active February 17, 2022 19:34
Phoenix 0.16.x to 0.17.0 upgrade instructions

Deps

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

def deps do
  [...
   {:phoenix, "~> 0.17"},
   {:phoenix_live_reload, "~> 1.0"},
  ...]
@chrismccord
chrismccord / upgrade.md
Last active August 29, 2015 14:26
Phoenix 0.15.x to 0.16.0 upgrade instructions

Phoenix dep

Update your phoenix dep:

def deps do
 [...,
  {:phoenix, "~> 0.16"},
  ...]
end
@chrismccord
chrismccord / phoenix-0.15-upgrade.md
Last active August 29, 2015 14:25
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
chrismccord / gist:57805158f463d3369103
Last active February 12, 2016 09:52
Phoenix Upgrade Instructions 0.13.x 0.14.0

First, bump your phoenix in mix.exs:

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

phoenix_html

Update your phoenix_html version to 1.1.0 in mix.exs:

defmodule MyApp.Password do
@moduledoc """
Handles password authentication, encryption, and decryption
"""
@doc """
Encrypte the password String
"""
def encrypt(raw_password) do