Skip to content

Instantly share code, notes, and snippets.

View hoangbits's full-sized avatar
🏝️
Working from earth

Le Gia Hoang hoangbits

🏝️
Working from earth
  • Thanh Hoa, Vietnam
  • 10:40 (UTC +07:00)
View GitHub Profile
@nfantone
nfantone / use-validation-schema.js
Last active May 29, 2024 01:55
Use `yup` with `react-final-form`
import { setIn } from 'final-form';
import { useMemo } from 'react';
/**
* Sets the `innerError.message` in an `errors` object at the key
* defined by `innerError.path`.
* @param {Object} errors The object to set the error in.
* @param {{ path: string, message: string }} innerError A `yup` field error.
* @returns {Object} The result of setting the new error message onto `errors`.
*/
@kieraneglin
kieraneglin / example_live_test.exs
Last active November 11, 2024 19:15
Pow sessions with LiveView (including tests)
defmodule MyAppWeb.ExampleLiveTest do
# `LiveviewCase` is a custom test helper - pretty much the same as ConnCase but with
# import Phoenix.LiveViewTest
# import MyApp.Support.AuthHelpers
use MyAppWeb.LiveviewCase, async: false
import MyApp.Factory
alias MyApp.Repo
alias MyAppWeb.ExampleLive
@frankdugan3
frankdugan3 / app.css
Last active June 13, 2025 10:39
Phoenix Tailwind v4
/* default is to use prefers-color-scheme */
/* if you want dark mode via class: */
@custom-variant dark (&:where(.dark, .dark *));
@custom-variant phx-click-loading (.phx-click-loading&, .phx-click-loading &);
@custom-variant phx-submit-loading (.phx-submit-loading&, .phx-submit-loading &);
@custom-variant phx-change-loading (.phx-change-loading&, .phx-change-loading &);
@plugin "./heroicons.tailwind.plugin.js";
@vkryukov
vkryukov / codex_beam_bootstrap.sh
Last active June 19, 2025 08:58
Installing Elixir/Erlang on Codex
#!/usr/bin/env bash
###############################################################################
# codex_beam_bootstrap.sh ─ OTP 27 + Elixir 1.18 behind Codex MITM proxy
###############################################################################
go install github.com/asdf-vm/asdf/cmd/[email protected]
asdf plugin add erlang https://github.com/michallepicki/asdf-erlang-prebuilt-ubuntu-24.04.git || true
asdf plugin add elixir
asdf install erlang 27.3.4
asdf set -u erlang 27.3.4