This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ElijahWeb.EnsureRolePlug do | |
@moduledoc """ | |
This plug ensures that a user has a particular role before accessing a given route. | |
## Example | |
Let's suppose we have three roles: :admin, :manager and :user. | |
If you want a user to have at least manager role, so admins and managers are authorised to access a given route | |
plug ElijahWeb.EnsureRolePlug, [:admin, :manager] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ElijahWeb.Router do | |
use ElijahWeb, :router | |
import ElijahWeb.UserAuth | |
import Plug.BasicAuth | |
alias ElijahWeb.EnsureRolePlug | |
pipeline :browser do | |
plug :accepts, ["html"] | |
plug :fetch_session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We need to import the CSS so that webpack will load it. | |
// The MiniCssExtractPlugin is used to separate it out into | |
// its own CSS file. | |
import "../css/app.scss" | |
// webpack automatically bundles all modules in your | |
// entry points. Those entry points can be configured | |
// in "webpack.config.js". | |
// | |
// Import deps with the dep name or local files with a relative path, for example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] an exception was raised: | |
** (Phoenix.Template.UndefinedError) Could not render "invitation_request.html" for ElijahWeb.InvitationRequestView, please define a matching clause for render/2 or define a template at "lib/elijah_web/templates/invitation_request/*". The following templates were compiled: | |
* invitation_request_loading.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] an exception was raised: | |
** (Phoenix.Template.UndefinedError) Could not render "invitation_request.html" for ElijahWeb.InvitationRequestView, please define a matching clause for render/2 or define a template at "lib/elijah_web/templates/invitation_request/*". The following templates were compiled: | |
* invitation_request_loading.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex(2)> org = Repo.get(Org, 1) | |
[debug] QUERY OK source="orgs" db=11.6ms decode=1.4ms queue=1.4ms idle=1333.3ms | |
SELECT o0."id", o0."basename", o0."shortname", o0."uuid", o0."hash_id", o0."inserted_at", o0."updated_at" FROM "orgs" AS o0 WHERE (o0."id" = $1) [1] | |
%Elijah.Schema.Org{ | |
__meta__: #Ecto.Schema.Metadata<:loaded, "orgs">, | |
basename: "app", | |
channels: #Ecto.Association.NotLoaded<association :channels is not loaded>, | |
hash_id: "6vz6", | |
id: 1, | |
inserted_at: ~U[2020-10-19 16:27:51Z], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ElijahWeb.SearchLive do | |
use ElijahWeb, :live_view | |
alias Elijah.Bank | |
require Logger | |
def mount(_params, _session, socket) do | |
socket = | |
assign(socket, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[debug] QUERY OK source="users" db=1.8ms decode=2.1ms queue=1.4ms idle=130.8ms | |
SELECT TRUE FROM "users" AS u0 WHERE (u0."email" = $1) LIMIT 1 ["[email protected]"] | |
#Ecto.Changeset< | |
action: nil, | |
changes: %{email: "[email protected]", password: "rubf6TFg"}, | |
errors: [], | |
data: #Elijah.Accounts.User<>, | |
valid?: true | |
> | |
#Ecto.Changeset< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// combinetest | |
// | |
// Created by Michael on 2020-08-25. | |
// Copyright © 2020 Michael. All rights reserved. | |
// | |
import Cocoa | |
import Combine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import VideoToolbox | |
import AVFoundation | |
private var __canHWAVC: Bool = false | |
private var __tokenHWAVC: dispatch_once_t = 0 | |
public protocol NYXAVCEncoderDelegate : class | |
{ | |
func didEncodeFrame(frame: CMSampleBuffer) | |
func didFailToEncodeFrame() |