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
static Maybe<string> TryGetErrorMessage(XElement html) | |
{ | |
return html.GetElementsByClassName("ErrorMessage").MaybeFirst(). | |
Where(x => !x.Attributes("style").Any() | |
|| !x.Attribute("style").Value.Contains("visibility:hidden")). | |
Or(html.GetElementsByClassName("ErrorText").MaybeFirst()). | |
Select(x => x.Value.Trim()); | |
} |
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
//add this as pre-request script on postman collection | |
const moment = require("moment") | |
const { | |
apiRoot, | |
authPath, | |
username, | |
password, | |
bearerTokenValidUntil | |
} = pm.variables.toObject(); |
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 App | |
open Elmish | |
type State = | |
{ CurrentUser: string option } | |
type Msg = | |
| SignIn of string | |
| SignOut |
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
let inline websocket<'Data> = | |
FunctionComponent.Of(fun (props: {| url : string; retryTimeSpan : TimeSpan; onConnected: bool -> unit; onMessage: 'Data -> unit |}) -> | |
let mutable currentlyConnected = false | |
let mutable wasAlreadyConnected = false | |
let connected = Hooks.useState false | |
let mutable webservice = null | |
let connect() = | |
if currentlyConnected then () else | |
let ws = WebSocket.Create(props.url) |
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 DapperFSharp = | |
open System.Data.SqlClient | |
open System.Dynamic | |
open System.Collections.Generic | |
open Dapper | |
let dapperQuery<'Result> (query:string) (connection:SqlConnection) = | |
connection.Query<'Result>(query) | |
let dapperParametrizedQuery<'Result> (query:string) (param:obj) (connection:SqlConnection) : 'Result seq = |