This file contains 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
namespace Utils | |
open System.IO | |
open System.Runtime.CompilerServices | |
type CurrentFile = | |
static member Path([<CallerFilePath>] ?file: string) = | |
file |> Option.defaultValue "" |
This file contains 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 Cache | |
open System | |
open Microsoft.AspNetCore.Http | |
open Microsoft.Extensions.Caching.Memory | |
type CacheExpiration = | |
| Absolute of DateTimeOffset | |
| AbsoluteRelativeToNow of TimeSpan | |
| Sliding of TimeSpan |
This file contains 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
namespace Sample | |
type MetadataResult<'value> = | |
{ | |
Value: 'value | |
Metadata: (string * string) list | |
} | |
module MetadataResult = | |
let init (value: 'a) = |
This file contains 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
// Single case union | |
[<Struct>] type MHPI = MHPI of double | |
// An entity that contains SCU | |
type Entity = { | |
Foo: string | |
Bar: MHPI | |
} | |
// JSON.NET Converter |
This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:xct="http://xamarin.com/schemas/2020/toolkit" | |
Shell.NavBarIsVisible="False" | |
Shell.TabBarIsVisible="False" | |
x:Name="xTodoPage" | |
x:Class="XamarinStore.Views.TodoPage"> | |
<ContentPage.Resources> | |
<ResourceDictionary> |
This file contains 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
/// Bindings for hookrouter.js | |
module HookRouter | |
// https://pastebin.com/dRsnyx4U | |
open Fable.Core | |
open Fable.Core.JsInterop | |
open Fable.React | |
open Fable.React.Props | |
open System.Text.RegularExpressions |
This file contains 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 Feliz | |
open Fable.Core.JsInterop | |
/// Uses the onbeforeunload event from a component via the useEffect hook. | |
/// Returning a value of true will notify the user that they may have unsaved changes. | |
let useUnload (promptOnExit: unit -> bool) = | |
let promptOnExitRef = React.useRef promptOnExit | |
React.useEffect(fun () -> | |
let handler (e: Browser.Types.Event) = | |
let prompt = promptOnExitRef.current() |
This file contains 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 Contexts | |
open Feliz | |
open Elmish.Toastr | |
open Elmish | |
open Domain.Auth | |
type ToastMessage = | |
| InfoMsg of string | |
| SuccessMsg of string |
This file contains 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 App | |
open Feliz | |
open Fable.React | |
open Fable.React.Props | |
open Fable.UIFabric | |
open Auth | |
open HookRouter | |
open Contexts |
This file contains 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 MyApp.Database.SqlProvider = | |
open FSharp.Data.Sql | |
open System.Data | |
#if DEBUG | |
// Print generated SQL to console | |
FSharp.Data.Sql.Common.QueryEvents.SqlQueryEvent |> Event.add (printfn "Executing SQL: %O") | |
#endif | |
[<Literal>] |
NewerOlder