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
| public static class SonyReger | |
| { | |
| public static async Task Register(LinkedAccountsModel InputLinkedAccountsModel, ProxyModel proxy) | |
| { | |
| await Task.Delay(1); | |
| using (var wb = DriverBuilder.MakeDriverForSony()) | |
| { | |
| wb.ClickEx(By.CssSelector("asdasd")); |
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
| public class PoolItem<T> : IDisposable | |
| { | |
| private readonly Action<PoolItem<T>> _onRelease; | |
| public T Value { get; } | |
| public PoolItem(T value, Action<PoolItem<T>> onRelease) | |
| { | |
| _onRelease = onRelease; | |
| Value = value; | |
| } |
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 TypeClasses | |
| open System | |
| let inline (|HasId|) x = (^a : (member Id : 'Id)x) // define type class | |
| let inline getId (HasId x) = x // call type class instance | |
| let inline (|HasShow|) x = (^a : (static member Show : ^a -> string)x) // define type class | |
| let inline show (HasShow x) = x // call type class instance | |
| let inline (|HasMap|) f x = (^x : (static member Map : ('a -> 'b) * ^x -> ^z) f, x) // define type class |
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 | |
| let inline (|HasMap|) f x = (^x : (static member Map : ('a -> 'b) * ^x -> ^z) f, x) // define type class | |
| let inline map f (HasMap f x) = x // call type class instance | |
| let inline (|HasPure|) x = (^x : (static member Pure : 'a -> ^x)x) | |
| let inline pure' (HasPure x) = x | |
| let inline (|HasBind|) f x = (^x : (static member Bind : ('a -> ^z) * ^x -> ^z)f, x) | |
| let inline bind f (HasBind f x) = x | |
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
| type Order = { Id: Guid; Amount: int } | |
| type Client = { Id: Guid; OpenOrders: int; Balance: int } | |
| type CreateOrderAggregate = { Client: Client; Order: Order } | |
| module CreateOrderAggregate = | |
| let execute (agg: CreateOrderAggregate) = | |
| if agg.Client.Balance >= agg.Order.Amount && agg.Client.OpenOrders < 5 then Ok agg |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Runtime.CompilerServices; | |
| using System.Threading.Tasks; | |
| using OpenQA.Selenium; | |
| using OpenQA.Selenium.Chrome; | |
| using OpenQA.Selenium.Remote; |
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
| using System; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using OpenQA.Selenium; | |
| namespace SeleniumExt | |
| { | |
| public static class DriverExt |
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
| public static class Ext | |
| { | |
| public static IObservable<string> AnonymousConsume(this IDatabase db, string topic, int prefetchCount = 100, CancellationToken? cancellationToken = null) | |
| { | |
| async Task<(string[], string lastPos)> SafeRead(string position) | |
| { | |
| try | |
| { | |
| var msgs = await db.StreamReadAsync(topic, position, prefetchCount); | |
| var items = msgs.SelectMany(s => s.Values) |
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
| using System; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.Extensions.Logging; | |
| using Udr.Application; | |
| namespace Udr.Web | |
| { | |
| public class ExceptionHandler : IMiddleware | |
| { |
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 | |
| open System.Collections.Generic | |
| let inline ( ^ ) f x = f x | |
| type Terminal<'next> = | |
| | WriteLine of string * (unit -> 'next) | |
| | ReadLine of unit * (string -> 'next) |