Skip to content

Instantly share code, notes, and snippets.

@tonysneed
tonysneed / message-handler.cs
Created June 25, 2020 17:11
MessageHandler
public abstract class MessageHandler : IMessageHandler
{
private IMessageHandler nextHandler;
public void SetNextHandler(IMessageHandler nextHandler)
{
this.nextHandler = nextHandler;
}
public virtual async Task<Message> HandleMessage(Message sourceMessage)
@tonysneed
tonysneed / event-processor.cs
Created June 25, 2020 16:54
EventProcessor
public abstract class EventProcessor<TSourceEvent, TSinkEvent> : EventProcessorBase, IEventProcessor
{
protected readonly IEventConsumer<TSourceEvent> consumer;
protected readonly IEventProducer<TSinkEvent> producer;
public EventProcessor(
IEventConsumer<TSourceEvent> consumer,
IEventProducer<TSinkEvent> producer,
params IMessageHandler[] handlers)
: base(handlers)
@tonysneed
tonysneed / profiles.json
Created November 7, 2019 01:19
Windows 10 Terminal Settings
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{79285a8e-036c-446f-8a9c-78994e34bf76}",
"profiles": [
{
"background": "#012456",
"backgroundImage": "C:/users/tony/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/RoamingState/darth.gif",
"backgroundImageOpacity": 0.699999988079071,
ports:
- "80:80"
- "443:443"
worker_processes 1;
events { worker_connections 1024; }
http {
sendfile on;
upstream web-api {
server api:5000;
FROM nginx:latest
COPY nginx.conf /etc/nginx/nginx.conf
COPY localhost.crt /etc/ssl/certs/localhost.crt
COPY localhost.key /etc/ssl/private/localhost.key
sudo openssl pkcs12 -export -out localhost.pfx -inkey localhost.key -in localhost.crt
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -config localhost.conf -passin pass:YourStrongPassword
[req]
default_bits = 2048
default_keyfile = localhost.key
distinguished_name = req_distinguished_name
req_extensions = req_ext
x509_extensions = v3_ca
[req_distinguished_name]
countryName = Country Name (2 letter code)
countryName_default = US
version: "3.7"
services:
reverseproxy:
build:
context: ./Nginx
dockerfile: Nginx.Dockerfile
ports:
- "80:80"