Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / test_helper.exs
Created March 7, 2016 16:31
Application.ensure_all_started(:hound)
ExUnit.start
Mix.Task.run "ecto.create", ~w(-r PatronLeague.Repo --quiet)
Mix.Task.run "ecto.migrate", ~w(-r PatronLeague.Repo --quiet)
Ecto.Adapters.SQL.begin_test_transaction(PatronLeague.Repo)
defmodule ApiHelper do
use ExUnit.Case, async: false
use PatronLeague.ConnCase
@napcs
napcs / JS Loading in web frameworks like Elixir
Last active January 20, 2020 04:05
Per-view JavaScript functions for Phoenix. Keeps things out of global space, allows a page to specifically invoke the JS it needs.
How to load page-specific JS functions and pass values to those functions when JS is loaded below your views.