sequenceDiagram
participant Customer
participant Database
participant Book_Handler as Book Handler
participant Room
participant Booked_Handler as Booked Handler
participant Email_Service as Email Service
Customer->>Database: Search available rooms
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
/** | |
* A reusable signing function using the token passed to a provider | |
* | |
* @param data data to sign | |
* @returns Base64 signature | |
*/ | |
export type TokenSign = (data: string) => Promise<string>; | |
/* | |
* Constants for signing |
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
export const PROMISE_SINGLETON_REJECTION_REASON = 'rejected by successor'; | |
/** | |
* Creates a context where by only the last called promise is resolved | |
* Previous ones would be rejected | |
* | |
* @example | |
* | |
* const context = createPromiseSingletonContext<string>(); | |
* const someApiCall = (result: string) => new Promise<string>(resolve => { |
I hereby claim:
- I am mrantix on github.
- I am mrantix (https://keybase.io/mrantix) on keybase.
- I have a public key ASBQIl4hmgX25PyYRe25edFEzqNmJOEuBwgnLDrXnvggago
To claim this, I am signing this object:
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
public class Changes<T> | |
{ | |
public Changes( | |
IEnumerable<T> toAddOrUpdate = null, | |
IEnumerable<T> toRemove = null) | |
{ | |
ToAddOrUpdate = toAddOrUpdate?.ToImmutableArray() ?? ImmutableArray<T>.Empty; | |
ToRemove = toRemove?.ToImmutableArray() ?? ImmutableArray<T>.Empty; | |
} |
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
export module Guid { | |
export function newGuid(): string { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' | |
.replace(/[xy]/g, | |
c => { | |
const r = Math.random() * 16 | 0; | |
const v = c === 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); |
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
public static class ObservableExtensions | |
{ | |
public static Builder<TBase> SwitchType<TBase>( | |
this IObservable<TBase> observable) | |
{ | |
return new Builder<TBase>(observable); | |
} | |
public class Builder<TBase> | |
{ |
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
internal class Program | |
{ | |
static readonly Regex VersionRE = new Regex(@"(\d+\.\d+\.\d+)(\-.*(\-\d+))?"); | |
static void Main(string[] args) | |
{ | |
var app = new CommandLineApplication(); | |
var pack = app.Command("pack", config => | |
{ | |
var versionArg = config.Argument("version", "Semamtic Version to pack e.g. (1.0.0-beta-1)", false); |
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
import { Injectable, NgZone } from '@angular/core'; | |
@Injectable() | |
export class ScrollService { | |
constructor( | |
private ngZone: NgZone) { | |
} | |
scrollTo(selector: string, focus?: boolean): void { |
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
services.AddDbContext<MyDataContext>( | |
o => o.UseSqlServer(settings.ConnectionString), | |
ServiceLifetime.Scoped, | |
ServiceLifetime.Singleton); | |
services.TryAddSingleton<Func<MyDataContext>>(sp => | |
() => new MyDataContext(sp.GetService<DbContextOptions<MyDataContext>>()) | |
); |
NewerOlder