Skip to content

Instantly share code, notes, and snippets.

@realark
realark / Program.cs
Created February 12, 2026 17:40
spawn one project log per eval case
using System.Diagnostics;
using Braintrust.Sdk.Eval;
using Braintrust.Sdk.Instrumentation.OpenAI;
using Braintrust.Sdk.Trace;
using OpenAI;
using OpenAI.Chat;
namespace Braintrust.Sdk.Examples.EvalExample;
class Program
@realark
realark / hello-claude-code.eval.ts
Created February 11, 2026 23:50
trace-claude-code for evals
import { Eval } from "braintrust";
import { spawn } from "child_process";
// Set DEBUG=1 to stream agent stdout/stderr to console
const DEBUG = process.env.DEBUG === "1";
// Optional: set CLAUDE_PLUGIN_DIR to pass --plugin-dir to claude
const CLAUDE_PLUGIN_DIR = process.env.CLAUDE_PLUGIN_DIR;
interface TaskInput {
@realark
realark / Program.cs
Created January 16, 2026 17:57
csharp-metadata-example
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Braintrust.Sdk;
using Braintrust.Sdk.Eval;
using Braintrust.Sdk.Instrumentation.OpenAI;
using OpenAI;
using OpenAI.Chat;
(in-package :cl-user)
;; -- RUNNING INSTRUCTIONS --
;; (ql:quickload '(:sdl2 :cl-opengl))
;; (load "glconsingdemo.lisp")
;; (basic-test)
(require :sdl2)
(require :cl-opengl)
@realark
realark / image-builder.lisp
Created November 20, 2019 21:44
close and re-open foreign libraries on lisp images
(let ((%loaded-libraries% (list)))
(defun %pre-image-save ()
(loop :for library :in (cffi:list-foreign-libraries :loaded-only t) :do
(format T "close foreign lib: ~A~%" library)
(push (cffi:foreign-library-name library) %loaded-libraries%)
(cffi:close-foreign-library library)))
(defun %post-image-load ()
(loop :while %loaded-libraries% :do
(let ((library-name (pop %loaded-libraries%)))
@realark
realark / instance-render.lisp
Created November 11, 2019 22:34
opengl instanced rendering with common lisp
;;;; Proof-of-concept for opengl instance rendering using cl-opengl
(eval-when (:compile-toplevel :load-toplevel)
(ql:quickload '(:cl-opengl :sdl2 :cl-soil :glkit)))
(defpackage :ark.gl
(:use :cl))
(in-package :ark.gl)
(require :sdl2)
(require :cl-opengl)
@realark
realark / ctriangle.cpp
Last active September 26, 2024 01:11
opengl hello triangle on c++ and common lisp
#include <iostream>
#include <string>
#include <GL/glew.h>
#include <GL/glu.h>
#include <SDL2/SDL.h>
// compile and run:
// rm csdlopengl ; gcc -o csdlopengl ctraingle.cpp -lSDL2 -lGLEW -lstdc++ -lGL && ./csdlopengl