Skip to content

Instantly share code, notes, and snippets.

module Shaper=
open LiteDB
open System
open TypeShape.Core
open TypeShape.Core.Utils
open LiteDB.FSharp
type Convert<'t> = {To:'t->BsonValue;From:BsonValue->'t}
@Szer
Szer / git-cleanup.ps1
Last active March 1, 2019 12:02
Deleting old remote branches which have been merged into master
function CleanupRepo {
param([string]$repo)
<#work directory should be repo root#>
cd $repo
git fetch "origin"
git reset --hard origin/master
"getting branch list..."
type StreamCons<'a> =
| Nil
| Cons of 'a * Stream<'a>
and Stream<'a> = Lazy<StreamCons<'a>>
let inline force (l: Lazy<_>) = l.Force()
let rec toStream l : Stream<_> =
lazy match l with
| [] -> Nil
@Szer
Szer / single-du-converter.fs
Created November 11, 2018 18:06
Single DU converter
[<AutoOpen>]
module SingleDuConverter
open Newtonsoft.Json
open Microsoft.FSharp.Reflection
open System
open System.Collections.Generic
open Newtonsoft.Json.Linq
type SingleDuConverter() =
@object
object / AkklingPersistence.txt
Created May 20, 2018 07:29
Akkling persistence example
1. Yaml configuration section
<?xml version="1.0" encoding="utf-8"?>
<akka.persistence>
<hocon>
<![CDATA[
akka {
persistence{
query.journal.sql {
max-buffer-size = 10000
@maestrow
maestrow / copy-to-readme.md
Last active March 24, 2018 04:36
Start Scripting with F# and Paket on Windows (Использование Paket в скриптах F# на Windows, автоматизация)