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 / 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;
@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 / 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 / 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 / ExpressionHelper.fs
Created August 5, 2022 09:25 — forked from MichaelGG/ExpressionHelper.fs
Example module that modifies F# expressions to be more C#-ish Expression<T>s
#if INTERACTIVE
#r "FSharp.PowerPack"
#r "FSharp.PowerPack.Linq"
#endif
open System
open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Linq.QuotationEvaluation
open System.Linq.Expressions
root = true
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
[*.fs]
@DejanMilicic
DejanMilicic / 0_README.md
Created March 25, 2022 14:50 — forked from YBogomolov/0_README.md
Idris 2 DevContainer

How to use Idris 2 in devcontainer

Step 1: build executable and libraries

Use the Dockerfile below to build the Idris 2 executable and standard library:

docker build --tag=idris2 .
@DejanMilicic
DejanMilicic / fsharp-fable-tips.md
Created February 27, 2022 12:22 — forked from enerqi/fsharp-fable-tips.md
Fable F# Notes

Basic Tooling Setup

Fable is an F# language to javascript compiler powered by Babel.

F# is a language that runs on a Microsoft CLR. Using the .NET Core CLR implementation it works on Windows, Mac or Linux.

F# Linux

  • .NET Core SDK - download the latest 2.1 SDK
  • Mono - mono-complete package
  • F# compiler - fsharp package from the mono repository
@DejanMilicic
DejanMilicic / App.fs
Created February 13, 2022 21:33 — forked from aspnetde/App.fs
Feliz – MVU with React Function Components
module App
open Elmish
type State =
{ CurrentUser: string option }
type Msg =
| SignIn of string
| SignOut