Skip to content

Instantly share code, notes, and snippets.

View jkone27's full-sized avatar
🌴
On vacation

gparmigiani jkone27

🌴
On vacation
View GitHub Profile
@jkone27
jkone27 / sdkman_oracle_jdk_macos.sh
Last active March 14, 2024 14:34 — forked from smola/sdkman_oracle_jdk.sh
Install Oracle JDK 8 for use with SDKMAN (test macos not working)
#!/bin/bash
#
# not working atm, Install Oracle JDK 8 for use with SDKMAN on macOS
# download not working...to fix
#
# https://download.oracle.com/otn/java/jdk/8u401-b10/4d245f941845490c91360409ecffb3b4/jdk-8u401-macosx-x64.dmg
# https://gist.github.com/wavezhang/ba8425f24a968ec9b2a8619d7c2d86a6
set -eu
@jkone27
jkone27 / fsharp-minimal-api.fsx
Last active March 7, 2024 12:26
F# aspnetcore minimal API working with OpenApi specs
#load "runtime-scripts/Microsoft.AspNetCore.App-latest-8.fsx"
// to gen the above run this script in the local folder
// https://raw.githubusercontent.com/TheAngryByrd/IcedTasks/master/generate-sdk-references.fsx
#r "nuget: Feliz.ViewEngine"
#r "nuget: Microsoft.AspNetCore.OpenApi"
#r "nuget: Swashbuckle.AspNetCore"
open Microsoft.AspNetCore
open Microsoft.AspNetCore.Builder
@jkone27
jkone27 / sql_provider_libs_copy.fsx
Created March 2, 2024 22:40
Copy dlls to libraries directory for SQLProvider
#r "nuget: Fli"
open Fli
// change these or pass as arguments (modify script)
[<Literal>]
let packagesFolder = "$HOME/.nuget/packages"
[<Literal>]
@jkone27
jkone27 / FsharpSampleFile.fsx
Created February 25, 2024 12:55
F# code sample comparion to ocaml
open System
module Test =
let hello world =
"hello " + world
let lst =
[
"world"
@jkone27
jkone27 / ocaml_sample_file.ml
Created February 25, 2024 12:54
ocaml sample file for comparison with F#
module Test = struct
let hello world =
"hello " ^ world
end
let lst =
[
"world";
"john";
@jkone27
jkone27 / ocean_heat_2023_2024.fsx
Created February 11, 2024 00:54
Ocean Heating 2023 to 2023
//open FSharp.Data.UnitSystems.SI
[<Measure>]
type g
[<Measure>]
type kg
[<Measure>]
type m
@jkone27
jkone27 / ccr001-spectre-sheets.fsx
Created January 28, 2024 00:45
use spectre console and csv to display workshop stats and partecipants in a table in fsharp scripts fsx
#r "nuget: FSharp.Data"
#r "nuget: EluciusFTW.SpectreCoff"
open FSharp.Data
open SpectreCoff
open System
type ``💁`` = CsvProvider<"./workshop.csv">
let sample = ``💁``.GetSample()
@jkone27
jkone27 / cliGameStub.fsx
Created January 25, 2024 22:30
F# fsx fsi workshop gist for creating as simple CLI game / stub in .NET with spectreconsole and more
//#r "nuget: Spectre.Console"
// https://mdbouk.com/how-to-create-beautiful-console-applications-with-spectre-console/
// https://www.asciiart.eu/animals/bears
//
#r "nuget: EluciusFTW.SpectreCoff"
#r "nuget: Spectre.Console.ImageSharp, 0.48.0"
#r "nuget: FSharp.Data"
#r "nuget: AlienFruit.FluentConsole.AsciiArt"
#r "nuget: FsHttp"
@jkone27
jkone27 / sheetCsvSpectre.fsx
Created January 22, 2024 21:11
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">
@jkone27
jkone27 / playgroundSpectre.fsx
Created January 22, 2024 11:52
playing around with spectre console and images on console with F# fsharp and dotnet
//#r "nuget: Spectre.Console"
// https://mdbouk.com/how-to-create-beautiful-console-applications-with-spectre-console/
// https://www.asciiart.eu/animals/bears
//
#r "nuget: EluciusFTW.SpectreCoff"
#r "nuget: FSharp.Data"
#r "nuget: AlienFruit.FluentConsole.AsciiArt"
#r "nuget: FsHttp"