Skip to content

Instantly share code, notes, and snippets.

@scrwtp
scrwtp / gist:246a4e763b1e6eb5eb2f6d5d72953eb5
Created January 28, 2020 00:02
Plugging a handwritten schema through document filter
namespace HandWrittenSchemas
open System
open System.IO
open Swashbuckle.AspNetCore.Swagger
open Swashbuckle.AspNetCore.SwaggerGen
open Microsoft.OpenApi.Readers
open Microsoft.OpenApi.Models
open System
module Game =
type Point = int * int
type Board = Map<Point, bool>
let empty m n =
[for y in 0 .. n - 1 do
for x in 0 .. m - 1 do
@scrwtp
scrwtp / core.clj
Last active January 25, 2018 20:42
sherlock-and-array
(ns sherlock-and-array.core
(:require
[clojure.string :as string]))
(defn sum [coll]
(reduce + 0 coll))
(defn solve
[s]
(loop [left []
namespace SO44893428
module Generic =
let nextId =
let mutable i = 0
let help (key:obj) =
i <- i + 1
i
help
@scrwtp
scrwtp / noflowcontrollazy.fsx
Created October 29, 2016 11:47
No-flow-control Lazy
module Lazy =
open System
type LazyAlt<'a> private (f: unit -> 'a) =
let sync = Object()
let cons : (unit -> 'a) ref = ref f
let getter : (unit -> 'a) ref = ref f