Skip to content

Instantly share code, notes, and snippets.


Renato Golia Kralizek

View GitHub Profile
Kralizek / Program.cs
Created Jul 22, 2022
LocalStack and Tye
View Program.cs
using Amazon.SQS;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddInMemoryCollection(new Dictionary<string, string> {
["AWS:Profile"] = "LocalStack",
["AWS:Region"] = "us-east-1"
var options = builder.Configuration.GetAWSOptions();
Kralizek / Program.cs
Last active Aug 2, 2022
Console application created using `System.CommandLine`
View Program.cs
using System.CommandLine;
using Amazon;
using Amazon.S3;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
var profileOption = new Option<string>("--profile", getDefaultValue: () => "default", description: "The name of the profile to use to access AWS services.");
var regionOption = new Option<string>("--region", getDefaultValue: () => RegionEndpoint.EUWest1.SystemName, description: "The region where AWS services are located.");
View unit-test-lifecycle.cs
using System.Diagnostics;
using NUnit.Framework;
public class RootFixtureSetup
public void OneTimeSetUp() => Debug.WriteLine("RootFixtureSetup:OneTimeSetUp");
Kralizek / FizBuz.cs
Last active Nov 26, 2019
FizBuz using pattern matching and LINQ
View FizBuz.cs
Enumerable.Range(1, 100)
static (bool isFizz, bool isBuzz, int n) CheckModulo(int n)
return (n % 3 == 0, n % 5 == 0, n);
Kralizek /
Last active Mar 17, 2019
RabbitMQ service on ECS

Empty file to get a better name for the gist

Kralizek / SmartAutoDataAttribute.cs
Last active Jun 27, 2022
A C# attribute deriving from AutoDataAttribute in AutoFixture.NUnit3 that can be customized per test.
View SmartAutoDataAttribute.cs
public class SmartAutoDataAttribute : AutoDataAttribute
public SmartAutoDataAttribute() : base(() => CreateFixture(null)) { }
public SmartAutoDataAttribute(Type type, string methodName) : base(CreateFixtureWithMethod(type, methodName)) { }
private static Func<IFixture> CreateFixtureWithMethod(Type type, string methodName)
if (type == null)
Kralizek / QueueSubject.cs
Last active Jan 12, 2019
A Rx subject that stores all values until an observer subscribes.
View QueueSubject.cs
public class QueueSubject<T> : ISubject<T>
private readonly Subject<T> _subject = new Subject<T>();
private readonly Queue<Action<IObserver<T>>> _actions = new Queue<Action<IObserver<T>>>();
private bool _isCompleted = false;
private Exception _error;
public bool IsRunning => !_isCompleted && _error == null;
public bool HasObservers => _refCount > 0;
Kralizek / AutoMoqError.csproj
Created Jan 2, 2019
AutoMoq can't generate a mock for a delegate when in the signature of a test method
View AutoMoqError.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PackageReference Include="AutoFixture" Version="4.6.0" />
Kralizek / thats-me.txt
Created Jun 18, 2018
Do not look here
View thats-me.txt
Born in Napoli, Italy, living in Stockholm, Sweden. Passionate about distributed software architecture and .NET. Proud owner of a Windows 10 Mobile.
CTO at Educations Media Group ( @emgdev )
View docker-info.txt
C:\Users\Renato> docker info
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 2
Server Version: 18.03.1-ce
Storage Driver: lcow (linux) windowsfilter (windows)