Skip to content

Instantly share code, notes, and snippets.

View jkone27's full-sized avatar
🦔
Back soon

gparmigiani jkone27

🦔
Back soon
View GitHub Profile
@jkone27
jkone27 / redis.fsx
Created March 16, 2022 21:25
learning redis
#r "nuget: StackExchange.Redis"
open StackExchange.Redis
open System.Threading.Tasks
// https://stackexchange.github.io/StackExchange.Redis/Basics
let redis = ConnectionMultiplexer.Connect("localhost")
let db = redis.GetDatabase()
@jkone27
jkone27 / fsharpOnionArch.fsx
Last active October 14, 2023 21:38
F# Onion Architecture
open System
open System.Threading.Tasks
module Domain =
type Order = { Number: string; Price: decimal; Type: string }
let changePrice order price =
{ order with Price = price }
@jkone27
jkone27 / FsCsInterop.md
Created September 23, 2022 07:43 — forked from swlaschin/FsCsInterop.md
F# to C# interop tips

Tips on exposing F# to C#

Api and Methods

I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.

In this file:

  • Define functions with PascalCase names. They will appear to C# as static methods.
  • Functions should use tuple-style declarations (like C#) rather than F#-style params with spaces.
@jkone27
jkone27 / 101-rx-samples.md
Created November 25, 2022 17:07 — forked from minhhungit/101-rx-samples.md
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress

@jkone27
jkone27 / 101-rx-samples.md
Created November 25, 2022 17:08 — forked from omnibs/101-rx-samples.md
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress

@jkone27
jkone27 / generateAspnetcore.fsx
Created April 14, 2023 14:58
script to generate aspnetcore load scripts for currently installed frameworks to be used in dotnet interactive
// original version of the script below, awesome thanks angry-byrd!
// https://github.com/TheAngryByrd/IcedTasks/blob/72638c8719014ae963f2662449c99f87090041d1/generate-sdk-references.fsx
open System
open System.IO
open System.Diagnostics
open System.Text.RegularExpressions
// This script is used to generate the .fsx files that are used to load the .NET SDK.
// It will generate a .fsx file for each version of the .NET SDK that is installed.
@jkone27
jkone27 / saturn.fsx
Created April 14, 2023 15:06
using saturn from an F# script
#load "runtime-scripts/Microsoft.AspNetCore.App-7.0.3.fsx"
#r "nuget: Saturn"
open Saturn
open Giraffe
let app = application {
use_router (text "Hello World from Saturn")
}
@jkone27
jkone27 / falco.fsx
Created April 14, 2023 15:07
F# minimal api in a single script with falco framework
#load "runtime-scripts/Microsoft.AspNetCore.App-7.0.3.fsx"
#r "nuget: Falco"
open Falco
open Falco.Routing
open Falco.HostBuilder
webHost [||] {
endpoints [
get "/" (Response.ofPlainText "Hello World")
@jkone27
jkone27 / huggingFacechat.fsx
Last active June 6, 2023 08:39
having fun with hugging face chat
#r "nuget: FSharp.Data"
open FSharp.Data
open FSharp.Data.JsonExtensions
// https://huggingface.co/inference-api
[<Literal>]
let responseJson =