I hereby claim:
- I am cjbell on github.
- I am cjbell (https://keybase.io/cjbell) on keybase.
- I have a public key ASByIAdUbSnPWd2v7tOLX7dqM8v6XCcQxGY3Hfb5wTcL7Ao
To claim this, I am signing this object:
defmodule Monitoring.Decorator do | |
@moduledoc """ | |
`Decorator` functions for doing monitoring. | |
""" | |
use Decorator.Define, [measure: 0, measure: 1] | |
alias Monitoring.Statix | |
require Logger |
# Usage in a controller | |
plug :load_and_authorize, [ | |
params: "account_id", | |
loader: &Accounts.get_account/1, | |
policy: AccountPolicy, | |
assign: :account | |
] when action in [:index] | |
# The plugs themselves |
I hereby claim:
To claim this, I am signing this object:
defmodule MyApp.PostController do | |
use MyApp.Web, :controller | |
import MyApp.Controllers.Helpers # this will bring in all of the helper methods into this controller | |
end |
defmodule MyApp.Web do | |
# ... Other lines removed for brevity | |
def controller do | |
quote do | |
use Phoenix.Controller | |
alias MyApp.Repo | |
import Ecto.Model | |
import Ecto.Query, only: [from: 2] |
defmodule MyApp.Controllers.Helpers do | |
import Plug.Conn | |
import Phoenix.Controller | |
def render_blank(conn) do | |
conn | |
|> send_resp(204, "") | |
end | |
def render_error(conn, status, opts) do |
defmodule Shop.Order do | |
use Shop.Web, :model | |
schema "orders" do | |
field :email, :string | |
has_one :address, Shop.Address | |
timestamps | |
end | |
<div class="article-43afx flex-3aS32 vertical-2asd4 centered-1xa1d"> | |
</div> |
<% styles = import_css("components/article") %> | |
<div class="<%= styles[:article] %>"> | |
<!-- ... more --> | |
</div> |
import articleStyles from '../../styles/components/article'; | |
class Article extends Component { | |
render() { | |
return ( | |
<div className={articleStyles.article}> | |
// ... more | |
</div> | |
); | |
} |