- What dependencies does it require? (npm, netfx, dotnet-core)
- Does it seem to be maintained?
- Does it have a good update story?
- How easy is it to get started? (good tutorial, templating)
- Can I change the structure easily to fit the divio structure?
- Does it support search? Is the search useful?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open System | |
| open Microsoft.AspNetCore.Builder | |
| open Microsoft.Extensions.Hosting | |
| open Microsoft.AspNetCore.Http | |
| open System.Threading.Tasks | |
| let mapGet (pattern : string) handler (app : WebApplication) = | |
| app.MapGet(pattern, (Func<_>(handler))) |> ignore | |
| let mapGetAsync (pattern : string) (handler : HttpContext -> Task) (app : WebApplication) = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Default1 = class end | |
| type Then = | |
| inherit Default1 | |
| static member inline Then ((x: Result<_,'E> , f: 'T->Result<'U,'E>), _mthd: Then) = Result.bind f x | |
| static member inline Then ((x: option<_> , f: 'T->Option<'U>), _mthd: Then) = Option.bind f x | |
| static member inline Invoke (mapping: 'T->'U) (source: '``Thenable<'T>``) : '``Thenable<'U>`` = | |
| let inline call (mthd: ^M, source: ^I, _output: ^R) = ((^M or ^I or ^R) : (static member Then : (_*_)*_ -> _) (source, mapping), mthd) | |
| call (Unchecked.defaultof<Then>, source, Unchecked.defaultof<'``Thenable<'U>``>) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Option = | |
| let inline bind ([<InlineIfLambda>] binder) value = | |
| match value with | |
| | Some x -> binder x | |
| | None -> None | |
| let inline map ([<InlineIfLambda>] mapper) value = | |
| match value with | |
| | Some x -> Some(mapper x) | |
| | None -> None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open System | |
| open Giraffe | |
| open Microsoft.AspNetCore.Http | |
| open System.Threading | |
| open System.Threading.Tasks | |
| module HttpHandlerHelpers= | |
| /// Converts an Async HttpHandler to a normal Giraffe Task based HttpHandler | |
| let inline convertAsyncToTask (asyncHandler : HttpFunc -> HttpContext -> Async<HttpContext option>) (next : HttpFunc) (ctx : HttpContext) : HttpFuncResult = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main = | |
| open System | |
| open System.Threading | |
| let inline tryCancel (cts : CancellationTokenSource) = | |
| try | |
| cts.Cancel() | |
| with :? ObjectDisposedException as e -> | |
| // if CTS is disposed we're probably exiting cleanly | |
| () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type AsyncBuilder with | |
| member inline __.Bind(t : Task<'a>, cont) = async.Bind(t |> Async.AwaitTask, cont) | |
| member inline __.Bind(t : Task, cont) = async.Bind(t |> Async.AwaitTask, cont) | |
| member inline __.ReturnFrom(t : Task<'a>) = async.ReturnFrom(t |> Async.AwaitTask) | |
| member inline __.ReturnFrom(t : Task) = async.ReturnFrom(t |> Async.AwaitTask) | |
| member inline __.Bind(t : ValueTask<'a>, cont) = async.Bind(t.AsTask() |> Async.AwaitTask, cont) | |
| member inline __.Bind(t : ValueTask, cont) = async.Bind(t.AsTask() |> Async.AwaitTask, cont) | |
| member inline __.ReturnFrom(t : ValueTask<'a>) = async.ReturnFrom(t.AsTask() |> Async.AwaitTask) | |
| member inline __.ReturnFrom(t : ValueTask) = async.ReturnFrom(t.AsTask() |> Async.AwaitTask) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //based on https://github.com/haf/expecto/blob/main/Expecto/Expecto.fs#L116-L118 | |
| /// allows you to build a context for tests given name | |
| let inline testContext (contextBuilder : string -> 'a) (testList: seq<string * ('a -> unit)>) = | |
| Seq.map (fun (name, partialTest) -> | |
| testCase name (fun () -> contextBuilder name |> partialTest)) testList | |
| // Build some context based on the name of the test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while [ $? -ne 0 ]; do !!; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for i in `find . -type f -iname "*.fsproj"`; do | |
| # get only filename | |
| project=`basename $i` | |
| # remove fsproj extension | |
| project=${project%.fsproj} | |
| references=`cat $i | grep '<ProjectReference' | cut -d "\"" -f 2` |