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
## jekyll deploy | |
adduser jekyll | |
adduser jekyll sudo | |
su jekyll ; cd /home | |
mkdir ~/.ssh ; cd .ssh | |
cat >> ~/.ssh/authorized_keys | |
ssh-rsa <pubkey> | |
sudo chmod 700 -R ~/.ssh && chmod 600 ~/.ssh/authorized_keys | |
mkdir -p /home/jekyll/static/my_app |
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 RedpillsWeb.CartLive do | |
use Phoenix.LiveView | |
alias RedpillsWeb.Router.Helpers, as: Routes | |
require Logger | |
@impl true | |
def mount(_params, session, socket) do | |
shopping_cart = Map.get(session, "shopping_cart", []) | |
IO.inspect(shopping_cart, label: "RedpillsWeb.CartLive shopping_cart") |
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 Markably.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
alias Markably.Accounts.Invitations | |
require Logger | |
def start(_type, _args) do |
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 Pearls.Repo.Migrations.CreateBibleBooks do | |
use Ecto.Migration | |
def change do | |
create table(:bible_books) do | |
add :name, :string | |
add :bible_id, references(:bible_versions, on_delete: :nothing) | |
add :testament, :string, null: false | |
timestamps() |
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
user_status: <%= @user.status %> | |
<div class="mb-6"> | |
<%= select(f, @user.status, @statuses) %> | |
</div> |
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 |