Skip to content

Instantly share code, notes, and snippets.

@CallumVass
CallumVass / ES.fs
Last active February 3, 2021 19:04
open System
open System.Collections.Generic
type ProductShipped =
{ Sku: string
Quantity: int
DateTime: DateTime }
type ProductReceived =
{ Sku: string
@CallumVass
CallumVass / migrator.fsx
Created July 29, 2021 14:36
Migration POC
#r "nuget: System.Data.SqlClient"
open System.Data
open System.Data.SqlClient
type Types =
| String
| Int
type Action =
@CallumVass
CallumVass / middleware.go
Last active October 14, 2023 18:42
Go - Function vs Method
package main
import (
"context"
"net/http"
"github.com/alexedwards/scs/v2"
)
type application struct {
@CallumVass
CallumVass / Program.cs
Created December 1, 2023 08:08
Wordpress To Markdown
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using HtmlAgilityPack;
const string baseUrl = "https://YOUR_DOMAIN_HERE";
// I know my site only had 14 pages, adjust accordingly
const int maxPageTraversal = 14;
var root = Directory.GetCurrentDirectory();
var converter = new ReverseMarkdown.Converter();
@CallumVass
CallumVass / anthropic.ts
Last active May 17, 2024 14:46
Haiku structured data - My own implementation of instructor for Haiku
import Anthropic from "@anthropic-ai/sdk";
import type { MessageParam } from "@anthropic-ai/sdk/resources";
import dotenv from "dotenv";
import { Instructor } from "./instructor";
import type { z } from "zod";
dotenv.config();
function sendToClaude<T>(message: MessageParam, schema: z.Schema<T>) {
const anthropicClient = new Anthropic({