Skip to content

Instantly share code, notes, and snippets.

View realvictorprm's full-sized avatar
😼
Fighting the bugs!

Victor Peter Rouven Müller realvictorprm

😼
Fighting the bugs!
  • Hivemind Technologies AG
  • Switzerland
  • 23:24 (UTC +02:00)
  • X @realvictorprm
View GitHub Profile
@TheAngryByrd
TheAngryByrd / GiraffeAsyncComposer.fs
Last active January 16, 2023 16:11
F# Giraffe Compose Async SRTP
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 =
@realvictorprm
realvictorprm / PaketDependencyManagementMadeEasy.fsx
Last active June 12, 2018 19:41
A must have for your script file to ease spreading a small proof of concept with dependencies!
open System
open System.IO
open System.Diagnostics
let downloadDependencies deps =
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
if not (File.Exists "paket.exe") then
async {
let url = "http://fsprojects.github.io/Paket/stable"
@realvictorprm
realvictorprm / API_Reference_Opener.fsx
Last active March 3, 2018 20:09
Provides the class ReferenceHelper with which one can simply open the documentation to a bash command through calling `helper.[commandyousearch]`
open System
open System.Net
open System.Text.RegularExpressions
open System.Collections.Generic
// Learn more about F# at http://fsharp.org. See the 'F# Tutorial' "project"
// for more guidance on F# programming.
module Option =
let inline defaultMap value f option = match option with | None -> value | Some value -> f value