Application.put_env(:sample, Example.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001],
server: true,
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
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
<!-- livebook:{"persist_outputs":true} --> | |
# Distribute | |
## Section | |
A small toy to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`. | |
```elixir | |
defmodule Distribute 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 MarkdownConverter do | |
import Phoenix.Component | |
def convert(filepath, body, _attrs, opts) do | |
convert_body(Path.extname(filepath), body, opts) | |
end | |
defp convert_body(extname, body, opts) when extname in [".md", ".markdown", ".livemd"] do | |
html = | |
Earmark.as_ast!(body, annotations: "%%") |
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 { FormError } from '$lib/errors.js'; | |
import { db } from '$lib/server/db.js'; | |
import { GROUP_QUERY } from '$lib/server/queries/group.query.js'; | |
import { | |
expenses_table, | |
group_members_table, | |
ledger_table, | |
users_table, | |
} from '$lib/server/schema.js'; | |
import { listify_names, sum_arr } from '$lib/utils.js'; |
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
FROM golang:1.21.0-bullseye as builder | |
COPY . /workdir | |
WORKDIR /workdir | |
ENV CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" | |
ENV GOFLAGS="-buildmode=pie" | |
RUN go build -ldflags "-s -w" -trimpath ./cmd/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 PentoWeb.UploadLive do | |
use PentoWeb, :live_view | |
# @bytes_for_5MB 5_242_880 | |
@bytes_for_5MB 1_000_000 | |
@impl Phoenix.LiveView | |
def mount(_params, _session, socket) do | |
socket = | |
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
defmodule TravelerWeb.SearchbarLive do | |
use TravelerWeb, :live_view | |
alias Phoenix.LiveView.JS | |
alias Traveler.Places | |
def mount(_params, _session, socket) do | |
socket = assign(socket, places: []) | |
{:ok, socket, layout: false} | |
end |
Here are the steps to update Phoenix Live SaaS Kit for Fly and Phoenix 1.6.9:
git init
,git add .
,git commit -m "init repo"
- Remove generated docker & deploy script files
build.sh
docker-entrypoint.sh
.dockerignore
Dockerfile
NewerOlder