Skip to content

Instantly share code, notes, and snippets.

@nikneroz
nikneroz / Guardian JWT.md
Last active October 10, 2023 19:13
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

@ernsheong
ernsheong / before_spec.rb
Created August 28, 2012 04:05
Testing behavior of before vs. before :each vs before :all
require 'spec_helper'
$count = 0
$count_each = 0
$count_all = 0
shared_examples_for "before :each" do
it { should == 1 }
it { should == 2 }
end