Skip to content

Instantly share code, notes, and snippets.

View carlgleisner's full-sized avatar

Carl Gleisner carlgleisner

View GitHub Profile
@PJUllrich
PJUllrich / audit.ex
Created May 12, 2026 10:58
The Prompts I use for finding Vulnerabilities in Elixir/Erlang projects
defmodule MyApp.Prompts.Audit do
@moduledoc """
Prompts for the audit pipeline. Two entry points:
* `audit_file/4` — embeds a single source file in the prompt and
runs `MyApp.CodingAgent` against it. Style is `:simple` or
`:deep`; the executor picks based on `audit.strategy`.
* `audit_directory/2` — whole-package audit. Spawns the agent with
`:cwd` set to the source dir so it can use Read/Grep/Bash.
"""
@emizuki
emizuki / readme.md
Last active May 6, 2025 18:16
1Password commit signing inside devcontainers
defmodule YourAPp.Gotenberg.Api do
alias YourApp.Gotenberg.Options
require Logger
@timeout 30_000
@doc """
Converts given URL to a PDF binary
"""
@spec html_to_pdf(binary, Options.t()) :: {:ok, binary} | {:error, any}
@pvalkone
pvalkone / adventures-in-lto-tape-on-freebsd.md
Last active March 18, 2026 11:02
Adventures in LTO tape on FreeBSD

Adventures in LTO tape on FreeBSD

It's dangerous to go alone! Take this.

What's all this nonsense, then?

The object of the present quest is to create a long-term archive of the tens of terabytes of media I've hoarded^Wcollected over the past 20 years. The said files are stored on a NAS that's currently running FreeBSD 13, and practically never change once they've been created.

In the unfortunate event of all my media going up in a puff of smoke, in lieu of restoring from an archive, I could always re-rip everything, but that's an endeavour I'd rather avoid altogether.

Comparing usage of Ash & Ecto

# https://gist.github.com/Gazler/b4e92e9ab7527c7e326f19856f8a974a

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, SamplePhoenix.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,
@brainlid
brainlid / .iex.exs
Created April 2, 2024 12:52
My .iex.exs file that lives in my Home directory. Gets loaded and used in every IEx session on my machines. I borrowed and stole all the great ideas from others an tweaked them over the years.
Application.put_env(:elixir, :ansi_enabled, true)
# IEx shell customization for color
# - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/
# - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/
# - Can add to a specific project or can put in the User home folder as a global config.
# Updates from:
# - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs
timestamp = fn ->
{_date, {hour, minute, _second}} = :calendar.local_time
Application.put_env(:example, Example.Endpoint,
server: true,
http: [ip: {127, 0, 0, 1}, port: 4001],
adapter: Bandit.PhoenixAdapter,
render_errors: [formats: [html: Example.ErrorHTML], layout: false],
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
Application.put_env(:ex_money, :default_cldr_backend, Example.Cldr)
@c0m4r
c0m4r / freebsd_ovh_vps.md
Last active March 1, 2026 18:47
FreeBSD installation on OVH VPS

FreeBSD installation on OVH VPS

OVH now offers FreeBSD as a distro choice, however you might still want to install a specific version yourself or choose another root filesystem. In such case - this guide is for you.

This guide explains how to install the FreeBSD on OVH VPS. This might also work for other VPS providers with the proper rescue system in place.

Inspired by https://www.klajnszmit.net/unix-bsd-linux/openbsd-on-ovh-vps

Table of contents:

@caspg
caspg / 1_searchbar_live.ex
Last active March 20, 2026 15:00
Example of real-time search bar implementation in Phoenix LiveView and Tailwind. Working example on https://travelermap.net/parks/usa
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
@zblanco
zblanco / getting_lazy_with_dataflow_graphs_in_elixir.livemd
Last active January 18, 2026 12:04
Getting Lazy with Dataflow Graphs in Elixir

Getting Lazy with Dataflow Graphs in Elixir

Intro

What do Tensorflow, Apache Airflow, Rule Engines, and Excel have in common?

Under the hood they all use DAGs to model data-flow dependencies of the program. Using graphs to model programs is great because you can modify the program at runtime. Lets talk about doing this in Elixir for great good.