Skip to content

Instantly share code, notes, and snippets.

View jonas1ara's full-sized avatar

Jonas Lara jonas1ara

View GitHub Profile
#!/usr/bin/dotnet fsi
open System
open System.Collections.Generic
open System.Globalization
open System.IO
open System.Net.Http
open System.Numerics
open System.Text
@jonas1ara
jonas1ara / WebServer.fsx
Last active March 10, 2026 07:27
Simple web server in F#
open System.Net
open System.Net.Sockets
open System.IO
open System.Text.RegularExpressions
open System.Text
/// A table of MIME content types.
let mimeTypes =
dict [".html", "text/html";
".htm", "text/html";
@jonas1ara
jonas1ara / Cube.fsx
Last active March 9, 2026 05:44
Cube in F#
open System
let mutable A, B, C = 0.0, 0.0, 0.0
let mutable cubeWidth = 20.0
let width, height = 160, 44
let zBuffer = Array.create (width * height) 0.0
let buffer = Array.create (width * height) ' '
let backgroundASCIICode = '.'
let distanceFromCam = 100.0