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
asyncapi: 2.5.0 | |
info: | |
title: Example | |
version: 0.1.0 | |
channels: | |
user/signedup: | |
subscribe: | |
message: | |
description: An event describing that a user just signed up. | |
payload: |
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 BidirectionalDictionary<TFirst, TSecond> | |
{ | |
internal Dictionary<TFirst, TSecond> FirstToSecondDictionary { get; set; } | |
internal Dictionary<TSecond, TFirst> SecondToFirstDictionary { get; set; } | |
internal BidirectionalDictionary() | |
{ | |
this.FirstToSecondDictionary = new Dictionary<TFirst, TSecond>(); | |
this.SecondToFirstDictionary = new Dictionary<TSecond, TFirst>(); | |
} |
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"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>XUnit unit test</Title> | |
<Author>Alexander Wichmann</Author> | |
<Description>Creates a unit test structure</Description> | |
<Shortcut>xtest</Shortcut> | |
</Header> | |
<Snippet> |
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 Demon | |
{ | |
private const int maxNameLength = 15; | |
private readonly IList<Underling> underlings = new List<Underling>(); | |
private Demon(string name, ushort age, Power power) | |
{ | |
if (string.IsNullOrWhiteSpace(name)) | |
{ | |
throw new ArgumentException($"'{nameof(name)}' cannot be null or whitespace.", nameof(name)); |
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 Demon | |
{ | |
private const int maxNameLength = 15; | |
private readonly IList<Underling> underlings = new List<Underling>(); | |
private Demon(string name, ushort age, Power power) | |
{ | |
if (string.IsNullOrWhiteSpace(name)) | |
{ | |
throw new ArgumentException($"'{nameof(name)}' cannot be null or whitespace.", nameof(name)); |
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
<template> | |
<div id="app"> | |
<input | |
v-on:focus="$event.target.select()" | |
ref="clone" | |
readonly | |
:value="text"/> | |
<button @click="copy">Copy</button> | |
</div> | |
</template> |
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
if (_configuration == null && Options.ConfigurationManager != null) | |
{ | |
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted); | |
} | |
var validationParameters = Options.TokenValidationParameters.Clone(); | |
if (_configuration != null) | |
{ | |
var issuers = new[] { _configuration.Issuer }; | |
validationParameters.ValidIssuers = validationParameters.ValidIssuers?.Concat(issuers) ?? issuers; |
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 async Task<OpenIdConnectConfiguration> GetAsync(string address, IDocumentRetriever retriever, CancellationToken cancel) | |
{ | |
OpenIdConnectConfiguration openIdConnectConfiguration = JsonConvert.DeserializeObject<OpenIdConnectConfiguration>(doc); | |
if (!string.IsNullOrEmpty(openIdConnectConfiguration.JwksUri)) | |
{ | |
string keys = await retriever.GetDocumentAsync(openIdConnectConfiguration.JwksUri, cancel).ConfigureAwait(false); | |
openIdConnectConfiguration.JsonWebKeySet = JsonConvert.DeserializeObject<JsonWebKeySet>(keys); | |
foreach (SecurityKey key in openIdConnectConfiguration.JsonWebKeySet.GetSigningKeys()) | |
{ |
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.AddAuthentication(options => | |
{ | |
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | |
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; | |
}).AddJwtBearer(options => | |
{ | |
options.Authority = "<yourdomain>"; | |
options.Audience = "<audience here>"; | |
}); |
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
if (_configuration == null && Options.ConfigurationManager != null) | |
{ | |
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted); | |
} |