Skip to content

Instantly share code, notes, and snippets.

View DejanMilicic's full-sized avatar
🎯
Focusing

Dejan Milicic DejanMilicic

🎯
Focusing
View GitHub Profile
@DejanMilicic
DejanMilicic / Program.fs
Created September 15, 2022 04:58 — forked from Savelenko/Program.fs
A modeling exercise in two acts with banning or verifying users in F# and the Onion architecture
(*
An exercise in modeling. Users can be verified or banned. A user can be banned only if their username is "offensive".
We assume the Onion architecture. Modules `User` and `VerifiedUser` belong to the model. Module `Application` belongs to
the application layer. Data access layer is omitted completely; it should be fairly trivial.
Note that the verified/banned aspect of a user is modeled "externally" to the notion of user itself. In particular,
there are no "aggregates" below which combine all aspects of a user.
*)
@DejanMilicic
DejanMilicic / Serilog.fs
Created January 21, 2023 00:06 — forked from AlbertoDePena/Serilog.fs
FSharp logger with Serilog (app insights and console sinks)
// NuGet Packages
// Serilog.Enrichers.Environment
// Serilog.Sinks.ApplicationInsights
// Serilog.Sinks.Console
open System
open Serilog
open Serilog.Events
[<RequireQualifiedAccess>]
@DejanMilicic
DejanMilicic / 01_SayHello.fsx
Created May 28, 2023 13:00 — forked from akimboyko/01_SayHello.fsx
Samples from "Actor-based Concurrency with F# and Akka.NET" http://bit.ly/FSharpAkkaNET
#time "on"
#load "Bootstrap.fsx"
open System
open Akka.Actor
open Akka.Configuration
open Akka.FSharp
open Akka.TestKit
// #Using Actor
@DejanMilicic
DejanMilicic / DataProtectionBuilderExtensions.cs
Created November 15, 2023 12:26 — forked from georgiosd/DataProtectionBuilderExtensions.cs
RavenDB ASP.NET Data Protection Repository
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using Microsoft.AspNetCore.DataProtection.Repositories;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;