Skip to content

Instantly share code, notes, and snippets.

View capitalist's full-sized avatar
🎯
Focusing

Joe Martinez capitalist

🎯
Focusing
View GitHub Profile
@herissondev
herissondev / ElixirAiAgent.ex
Created August 13, 2025 14:55
Minimal AI agent in elixir
defmodule ElixirAiAgent do
@moduledoc """
A minimal ai agent implementation showcasing how simple it is to build AI agents in Elixir.
Combines agent logic and server management in one module.
"""
use GenServer
alias LangChain.Chains.LLMChain
alias LangChain.Message

Visualize primary and replicas (inspired by Waterpark)

Mix.install([
  {:kino, "~> 0.16.1"}
], consolidate_protocols: false)

Library modules

@rain-1
rain-1 / base model trends.md
Last active July 18, 2025 19:03
base model trends.md

Generating Code

Use list_generators to list available generators when available, otherwise mix help. If you have to run generator tasks, pass --yes. Always prefer to use generators as a basis for code generation, and then modify afterwards.

Tools

Use tidewave MCP tools when available, as they let you interrogate the running application in various useful ways.

Logs & Tests

@bcardarella
bcardarella / vml-swiftui.md
Last active June 25, 2025 01:45
VML - SwiftUI

View Markup Language (VML) Specification - SwiftUI

Version 1.0-alpha.1

1. Overview

View Markup Language (VML) is a markup language derived from SGML, designed to represent composable UI frameworks for unidirectional, server-driven rendering. This specification defines the conversion from a server-side view model, such as SwiftUI, to VML.

Specification Note 1.1: Scope The VML specification is concerned exclusively with the structure and rendering of views. It is a unidirectional standard (server-to-client). Mechanisms for handling user interactions, actions, and client-to-server state changes are explicitly outside the scope of this document.

@aeons
aeons / config.exs
Last active April 1, 2025 00:33
Erlang 27 :json module in Phoenix
config :phoenix, :json_library, ErlJson
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)

Have GPT-4 write a song

Mix.install(
  [
    {:midiex, "~> 0.6.1"},
    {:instructor, "~> 0.0.5"}
  ],
  config: [
    instructor: [
@hugobarauna
hugobarauna / kino_json_input_poc.livemd
Last active April 9, 2024 15:06
Kino JSON input with syntax highlight

Kino JSON Input Proof of Concept

Mix.install([
  {:kino, "~> 0.12.3"},
  {:jason, "~> 1.4"}
])
@adtac
adtac / Dockerfile
Last active July 13, 2025 20:06
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3