Skip to content

Instantly share code, notes, and snippets.

View jonas1ara's full-sized avatar

Jonas Lara jonas1ara

View GitHub Profile
@jonas1ara
jonas1ara / WebServer.fsx
Created April 29, 2024 06:34
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 / sheetCsvSpectre.fsx
Created January 24, 2024 23:56 — forked from jkone27/sheetCsvSpectre.fsx
Print in a table a google sheet published as csv with spectre console and fsharp data csv provider
#r "nuget: FSharp.Data"
#r "nuget: EluciusFTW.SpectreCoff"
open FSharp.Data
open SpectreCoff
type ``💁`` =
// just create your own google sheet and publish it from File menu, select CSV
// or use any other CSV, this works with any valid csv published in url or in your file system
CsvProvider<"https://docs.google.com/spreadsheets/d/e/GOOGLEKEYBLABLABLABLABLA/pub?output=csv">
@jonas1ara
jonas1ara / cube.fsx
Created January 4, 2024 17:31
Cube written in C ported to 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
@jonas1ara
jonas1ara / Program.fs
Created October 31, 2023 05:00
Sentiment analysis using ML.NET and F#
open Shared
open System
open System.IO
open Microsoft.ML
open Shared.Models.MLModel
// Define variables
let baseDirectory = __SOURCE_DIRECTORY__
let baseDirectory' = Directory.GetParent(baseDirectory)
@jonas1ara
jonas1ara / script.fsx
Created December 22, 2021 09:15 — forked from luisquintanilla/script.fsx
Style Transfer: Image to Mosaic F#, ML.NET, ONNX Sample
#r "nuget:Microsoft.ML"
#r "nuget:Microsoft.ML.OnnxRuntime"
#r "nuget:Microsoft.ML.OnnxTransformer"
#r "nuget:Microsoft.ML.ImageAnalytics"
#r "nuget:System.Drawing.Common"
open System.IO
open System.Drawing
open Microsoft.ML
open Microsoft.ML.Data