Skip to content

Instantly share code, notes, and snippets.

@karlseguin
karlseguin / db.ex
Created February 5, 2022 03:39
Elixir without Ecto, A thin Postgrex wrapper
# see https://www.openmymind.net/Elixir-Without-Ecto/
defmodule A.DB do
defmacro __using__(_) do
quote location: :keep do
@name __MODULE__
def child_spec(opts) do
%{
id: __MODULE__,
@odyright
odyright / Phoenix JWT.md
Created February 21, 2018 16:24 — forked from nikneroz/Phoenix JWT.md
Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

User model bootstrap

Let's generate User model and controller.

mix ecto.create
mix phoenix.gen.json Accounts User users email:string password_hash:string