Skip to content

Instantly share code, notes, and snippets.

View panot-hong's full-sized avatar

Panot Thaiuppathum (Hong) panot-hong

View GitHub Profile
using System.Collections.Concurrent;
using System.Text;
namespace AwaitableProducerSample
{
internal class AwaitableBlockBuilder : BlockBuilderBase
{
private readonly BlockingCollection<(byte[], TaskCompletionSource<string> taskSource)> _writeBuffer;
public AwaitableBlockBuilder()
using System.Collections.Concurrent;
using System.Text;
namespace AwaitableProducerSample
{
internal class SimpleBlockBuilder : BlockBuilderBase
{
private readonly CancellationTokenSource _cancellationTokenSource;
private readonly ConcurrentQueue<byte[]> _writeBuffer;
namespace PassThroughScopeSample
{
public static class ServiceProviderExtension
{
public static IServiceScope CreateServiceScope(this IServiceProvider provider)
{
var newScope = provider.GetRequiredService<IServiceScopeFactory>().CreateScope();
// Copy tenant identifier values from original scope to the new scope
var originalTenantIdentifier = provider.GetRequiredService<TenantIdentifier>();
@panot-hong
panot-hong / 2019-https-localhost.md
Created March 8, 2021 07:20 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).