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.cs
Created November 16, 2021 09:40 — forked from phillip-haydon/program.cs
RavenDB Projection Sample
using System;
using System.Collections.Generic;
using System.Linq;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Indexes;
using Raven.Client.Linq;
namespace RavenDBProjectionTest
public BusinessQuery()
{
Map = prods => from prod in prods
select new
{
Language = prod.Language,
Categories = prod.Categories,
Areas = prod.Areas,
Date = prod.Dates != null ? prod.Dates.Select(x => x.Date).DefaultIfEmpty() : null,
Subjects = prod.Subjects,
@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
@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 / 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 .
root = true
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
[*.fs]
@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
@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>]