Skip to content

Instantly share code, notes, and snippets.

View pkese's full-sized avatar

Peter Keše pkese

  • JSI, OECD
  • Ljubljana
View GitHub Profile
@pkese
pkese / episari65.fsx
Last active November 13, 2021 09:33
#!/usr/bin/env -S dotnet fsi /langversion:preview
// - Fetch EPISARI hospitalizations data from podatki.gov.si
// - Fetch vaccination data from api.sledilnik.org/api/vaccinations
// - Mix in static population demography data
// - Render hospitalizatized per 100k population json
#r "nuget: FSharp.Data, 4.2.5"
#r "nuget: FSharp.Json, 0.4.1"
@pkese
pkese / reformatted.fs
Last active August 19, 2022 19:08
OOP style minimal API formatting
open System
open Microsoft.AspNetCore.Builder
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.DependencyInjection
[<EntryPoint>]
let main args =
let builder = WebApplication.CreateBuilder(args)
builder
.Services
@pkese
pkese / PlotlyRepro.ipynb
Created March 1, 2023 16:10
Chart flashing Polyglot repro
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pkese
pkese / Holidays.fs
Last active November 13, 2023 17:40
Local holidays
open System
type DateOnly with
/// returns the date of Easter Monday for the given year
static member gaussEasterMonday (Y:int) =
let P = float Y / 100.0 |> floor // century
let M = // M depends on the century of year Y. For 19th century, M = 23. For the 21st century, M = 24 and so on
let Q = (13.0 + 8.0 * P) / 25.0 |> floor
int (15.0 - Q + P - (P / 4.0 |> floor)) % 30
let D = // The number of days to be added to March 21 to find the date of the Paschal Full Moon is