Mix.install([
{:req, "~> 0.5.6"},
{:kino, "~> 0.14.1"}
])
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 AlchemistWeb.Endpoint do | |
use Phoenix.Endpoint, otp_app: :alchemist | |
def call(conn, opts) do | |
conn | |
|> AlchemistWeb.ReplayPlug.call(AlchemistWeb.ReplayPlug.init(nil)) | |
|> case do | |
%{halted: true} = conn -> conn | |
conn -> super(conn, opts) | |
end |
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
#!/bin/bash | |
cleanup() { | |
echo "destroy your machine" | |
fly m destroy --force | |
exit 0 | |
} | |
trap 'cleanup' SIGINT |
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
Mix.install([ | |
{:liveview_playground, "~> 0.1.1"} | |
]) | |
defmodule PageLive do | |
use LiveviewPlaygroundWeb, :live_view | |
def mount(_params, _session, socket) do | |
socket = assign(socket, tab: "home") | |
{:ok, 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 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
@doc """ | |
Renders an input with label and error messages. | |
A `Phoenix.HTML.FormField` may be passed as argument, | |
which is used to retrieve the input name, id, and values. | |
Otherwise all attributes may be passed explicitly. | |
## Types | |
This function accepts all HTML input types, considering that: |
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
async function sendMessage(bot, source, items, formatter, getUrl) { | |
const successfullySentIds = [] | |
for (const item of items) { | |
const doSend = async () => { | |
await bot.telegram.sendMessage(TELEGRAM_CHANNEL, formatter(source, item), { | |
parse_mode: 'markdown', | |
}) | |
successfullySentIds.push(item.id) | |
} |
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
extends Node2D | |
var camera2D: Camera2D | |
var tween: Tween | |
func _ready(): | |
camera2D = $Camera2D | |
func transition_camera2D(from: Camera2D, to: Camera2D, duration: float = 1.0) -> void: | |
if transitioning: return |
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
fly machine run telegrammessenger/proxy:latest \ | |
-p 4444:443/tcp \ | |
--memory 1024 \ | |
--region gru \ | |
--env SECRET=SECRETGOESHERE \ | |
-a APPNAME |
NewerOlder