Skip to content

Instantly share code, notes, and snippets.


Alan Peabody alanpeabody

  • Burlington, Vermont
View GitHub Profile
View output
Unknown functions:
alanpeabody /
Created Jul 17, 2016
Running a elixir dependency's migrations from parent app (in parent repo)


To pull in dependencies and have them run their migrations in the parent apps' repo.


MyChild - A mix application with ecto migrations, schemas, etc. MyParent - A phoenix application that wants to leverage the child application.

In this case MyParent has added MyChild as a mix dependency via github, eg:


Keybase proof

I hereby claim:

  • I am alanpeabody on github.
  • I am alanpeabody ( on keybase.
  • I have a public key ASBfa3-DEWUJUKe4a5LeMKEeNJ3dyBwn93SXcewQPoDMpQo

To claim this, I am signing this object:

alanpeabody / local_storage.ex
Last active Jul 16, 2017
JS's LocalStorage in Elixir - A super simple intro to GenServer for js devs
View local_storage.ex
defmodule LocalStorage do
use GenServer
def start_link do
GenServer.start_link(__MODULE__, %{}, name: __MODULE__)
def set_item(key, val) do

(Breakfast) Tacos

This is really a two meal recipe, with my favorite the second meal - breakfast!

You can prepare the meat either on the gril or in a crock pot. If you prepare on the grill buy better steak.


  • Sweet Onion - Diced fine
  • Steak.
alanpeabody /
Last active Aug 29, 2015
JaSerializer Serialization Milestones

JaSerializer Roadmap

The initial release of JaSerializer successfully accomplishes it's mission; it serializes data to format.


  • Solidify/determine future of the DSL.
  • Better Ecto integration.
  • A Phoenix view integration.
alanpeabody / my_app.ex
Last active Sep 15, 2022
Websockets in Elixir with Cowboy and Plug
View my_app.ex
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
View dev_code_reload_plug.ex
# Reload/recompile code before each request in development only using Plug & Mix.
# Assumes MyApp.Router is a plug that handles actual routing.
def MyApp.Main do
use Plug.Builder
plug :reload
plug :dispatch
def reload(conn, _opts) do
if Mix.env == :dev, do:["--ignore-module-conflict"])
alanpeabody /
Last active Aug 29, 2015

Relax DSL expansion.

Serialization has been moved to the JaSerializer library with the intent of improving the routing/resource DSL to provide more out of the box functionality.


  • Super easy to create simple compliant RESTful APIs.
  • Standard Ecto models need little to no "wiring" to get working.
  • Improved DSL for working with non Ecto models (eg: Mnesia, ETS, Riak, etc)
  • Complete ability to override anything as needed.
alanpeabody / ja_serializer.ex
Created Jun 14, 2015
JSON API serializers - w/o routing
View ja_serializer.ex
defmodule JaSerializer do