This file contains hidden or 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 Postline.IntegrationCase do | |
@moduledoc """ | |
This module defines the setup for tests requiring | |
access to real external services like OpenAI. | |
Integration tests are meant to test actual integration with | |
third-party services and are not run by default with `mix test`. | |
Use `mix test.integration` to run integration tests. |
This file contains hidden or 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 Prompts.AIMessageSigils do | |
@moduledoc """ | |
Provides sigils for creating AI message structures with liquid template validation. | |
This module includes: | |
- `~SYSTEM` for system messages | |
- `~ASSISTANT` for assistant messages | |
- `~USER` for user messages | |
Each sigil validates the Liquid template syntax at compile time and returns a |
This file contains hidden or 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
export function usePushEvent<T extends object, Params extends object = object>( | |
eventName: string, | |
defaultValue?: T | |
) { | |
const live = useLiveVue(); | |
const isLoading = ref(false); | |
const isFinished = ref(false); | |
const response = ref<T | undefined>(defaultValue); | |
const error = ref<string | null>(null); | |
const execute = (data: Params) => { |
This file contains hidden or 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
window.addEventListener("phx:page-loading-start", (_info) => { | |
Array.from(document.getElementsByTagName("a")).forEach( | |
(a) => (a.dataset.active = "false") | |
); | |
}); | |
window.addEventListener("phx:page-loading-stop", (_info) => { | |
Array.from(document.getElementsByTagName("a")).forEach( | |
(a) => {a.dataset.active = (a.href === document.location.href).toString()} | |
); |
This file contains hidden or 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
<.flash_group flash={@flash} /> | |
<main> | |
<%= @inner_content %> | |
</main> | |
<%!-- We're doing teleport because navigation is rendered in root layout which is not updated --%> | |
<%!-- Notice "hidden" class, it's important because we're not really teleporting content, but duplicating it --%> | |
<div :if={@current_user} id="onboarding-render" phx-hook="teleport" data-teleport-target="onboarding" class="hidden"> | |
<MyApp.Onboarding.onboarding current_user={@current_user} /> |
This file contains hidden or 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
docker run --rm -it elixir:1.16 mix run --no-mix-exs -e 'Mix.install(dockerexec: "~> 2.0")' | |
* creating /root/.mix/archives/hex-2.0.6 | |
Resolving Hex dependencies... | |
Resolution completed in 0.01s | |
New: | |
dockerexec 2.0.3 | |
* Getting dockerexec (Hex package) | |
* creating /root/.mix/elixir/1-16/rebar3 | |
===> Fetching rebar3_hex v7.0.7 |
This file contains hidden or 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 contextlib import contextmanager | |
from contextvars import ContextVar | |
from functools import wraps, partial | |
_sequential_execution_active = ContextVar('bulk_update_active', False) | |
_sequential_execution_callbacks = ContextVar('bulk_update_callbacks', None) | |
@contextmanager |
This file contains hidden or 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 | |
set -e | |
DISK="$1" | |
MOUNTPOINT="$2" | |
if [ -z "$DISK" ] || [ -z "$MOUNTPOINT" ]; then | |
echo "Usage: run.sh DISK MOUNTPOINT" | |
exit 1 |
This file contains hidden or 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 collections import defaultdict | |
from operator import itemgetter | |
from time import time | |
from binance.client import Client | |
FEE = 0.0005 | |
PRIMARY = ['ETH', 'USDT', 'BTC', 'BNB'] | |
This file contains hidden or 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 openjdk:8 | |
ENV JAVA_OPTS="" | |
WORKDIR /srv | |
COPY snapshot.jar . | |
CMD ["java $JAVA_OPTS -jar snapshot.jar"] |
NewerOlder