Skip to content

Instantly share code, notes, and snippets.

View AngelMunoz's full-sized avatar
🏠
Working from home

Angel D. Munoz AngelMunoz

🏠
Working from home
View GitHub Profile
@AngelMunoz
AngelMunoz / PerlaDevServer.fs
Last active July 13, 2025 05:47
A GH Copilot suave implementation of the existing aspnet server that backs the Perla Dev Server. The overall generation of this file was a few mintues with a couple of hours of mine refining some details around the observable utilities as well as some of the handlers
namespace Perla.SuaveService
open System
open System.IO
open System.Net
open System.Text
open System.Threading.Tasks
open Microsoft.Extensions.Logging
open IcedTasks
@AngelMunoz
AngelMunoz / jspm-api.fsx
Last active June 30, 2025 16:15
A small script that provides a slight wrapper over the jspm.io API (rough state and with AI suggestions that need to be cleaned up
#r "nuget: FsHttp"
#r "nuget: IcedTasks"
#r "nuget: JDeck, 1.0.0-beta-006"
open System
open System.Text.Json
open System.IO
open FsHttp
open IcedTasks
open JDeck
@AngelMunoz
AngelMunoz / Htmx.kt
Created January 15, 2024 01:51
A few non exhaustive Htmx bindings and helpers for ktor and kotlin.html
package me.tunaxor.htmx
import io.ktor.server.application.*
import io.ktor.server.request.*
import io.ktor.server.response.*
import kotlinx.html.CommonAttributeGroupFacade
enum class HxSwap {
InnerHTML,
OuterHTML,
#r "nuget: TheBlunt"
open TheBlunt
module Common =
let RequiedMark =
pchar
(fun c -> c = '!')
(fun c -> $"$%c{c} is not a valid required mark.")
@AngelMunoz
AngelMunoz / UrlParser.fs
Last active October 26, 2023 21:28
Parse the segments + query + hash from a url with fparsec
namespace Routerish
type QueryValue =
| String of string option
| StringValues of string list
type RoutePart =
| Segment of segment: string
| ParamSegment of paramname: string
| Query of query: Map<string, QueryValue>
// differentiate the kind of payload you want to take
type AdditionPayload =
| Integers of int * int
| Strings of string * string
module Operations =
// handle your integers
let private addInts a b = a + b
// handle your strings
module Commands =
open FSharp.SystemCommandLine
open FSharp.SystemCommandLine.Aliases
type RunConfiguration with
static member FromString(value: string) =
module MyFunctions
let add a b = a + b
let printValue value = printfn "%s" value
@AngelMunoz
AngelMunoz / xml-to-json.fsx
Created September 22, 2022 03:46
A small F# plugin to work in a PoC
#i "nuget: C:/Users/scyth/repos/Perla/src/nupkg"
#i "nuget: https://api.nuget.org/v3/index.json"
#r "nuget: Newtonsoft.Json, 12.0.3"
#r "nuget: CalceTypes, 1.0.2"
open System.IO
open System.Xml
open Newtonsoft.Json
open type System.Text.Encoding
@AngelMunoz
AngelMunoz / meme-editor.imba
Last active September 11, 2022 04:59
A simple canvas based meme-like editor
const sizeOrMax\((size: number, max: number) => number) =
do(size,max) size > max ? max : size
export tag MemeEditor
css .row
d: flex; fld: column
css footer
d:flex; fld:column; m:auto
css canvas