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
cd repos; dotnet new webapi -lang F# -o FalcoSample | |
cd FalcoSample; dotnet add package Falco | |
code -r . | |
open System | |
open Microsoft.AspNetCore.Http | |
open Falco | |
open Falco.Routing | |
open Falco.HostBuilder |
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
namespace Extensions | |
open System | |
open System.Runtime.CompilerServices | |
open System.IO | |
open System.Threading.Tasks | |
open Microsoft.AspNetCore.Antiforgery | |
open Microsoft.AspNetCore.Http | |
open Microsoft.Extensions.DependencyInjection | |
open Microsoft.Extensions.Primitives |
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
Param($version = "latest") | |
$baseUrl = "https://api.github.com"; | |
$releasesUrl = "$baseUrl/repos/AngelMunoz/Perla/releases"; | |
$releasesLatestUrl = "$releasesUrl/latest"; | |
$releasesByTagUrl = "$releasesUrl/tags/v"; | |
$outDir = "$Env:USERPROFILE\.perla"; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script> |
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 Lit.Extensions | |
open Fable.Core | |
open Fable.Core.JsInterop | |
open Lit | |
[<Interface>] | |
type ReactiveController = | |
abstract member hostConnected : unit -> unit |
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
#r "nuget: FSharp.SystemTextJson, 0.17.4" | |
#r "nuget: Ply, 0.3.1" | |
open System.IO | |
open System.Text.Json | |
open System.Text.Json.Serialization | |
open System |
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.IO | |
// each case is kind of a "label" | |
// active patterns are limited to 7 choices though so keep that in mind | |
let (|IsNet50|Else|EndsWithSlash|) (path: string) = | |
if path.EndsWith("net5.0") then | |
IsNet50 | |
else if path.EndsWith('/')then | |
EndsWithSlash | |
else Else path |
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
// string interpolation in F# can be type safe | |
// specifying the data type you need in the "hole" of that string | |
// or you can fallback to the "ToString" one | |
$"Frank is %i{10} years old" | |
$"That'ts not %b{true}" | |
$"Bet' you can't print a list %A{[1;2;3;4]}" | |
$"Yeah but do tou need to specify data type? %{false}" | |
// or the equivalent in older versions which is good to use as well |
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
#r "nuget: FsHttp" | |
// uses https://github.com/ronaldschlenker/FsHttp | |
open FsHttp | |
http { | |
GET "https://jsonplaceholder.typicode.com/users" | |
Accept "application/json" // Accepts Header | |
} |
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
export interface ISwitchCameraArgs { | |
deviceId?: string | |
} | |
export interface IStartCameraArgs { | |
constraints?: MediaStreamConstraints; | |
retryCount?: number; | |
} | |
export interface ICameraDevice extends MediaDeviceInfo { |