Simulation of the Prisoners riddle as seen on Veritasium YouTube
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
using Microsoft.CodeAnalysis; | |
namespace ReactiveUI.SourceGenerators; | |
[Generator] | |
public class AttributeGenerator : ISourceGenerator | |
{ | |
public void Initialize(GeneratorInitializationContext context) | |
{ | |
} |
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
using System.Security.Claims; | |
using Microsoft.AspNetCore.Http; | |
namespace TypedClaimsPrincipal; | |
public interface IClaimsPrincipalProperties<out T> | |
where T : IClaimsPrincipalProperties<T> | |
{ | |
static abstract T Create(ClaimsPrincipal claimsPrincipal); | |
} |
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 ObsoleteLoggingInterceptor : Interceptor | |
{ | |
private readonly ILogger<ObsoleteLoggingInterceptor> _logger; | |
public ObsoleteLoggingInterceptor(ILogger<ObsoleteLoggingInterceptor> logger) | |
{ | |
_logger = logger; | |
} | |
public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(TRequest request, |
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 Main(string[] args) | |
{ | |
var host = CreateHostBuilder(args).Build(); | |
var task = host.RunAsync(); | |
var serverAddresses = host.Services.GetRequiredService<IServer>() | |
.Features | |
.Get<IServerAddressesFeature>(); |
I hereby claim:
- I am markrendle on github.
- I am rendle (https://keybase.io/rendle) on keybase.
- I have a public key ASDQ0O3lbZRJvt1ZVJW5eOADbKKANZ3TNvT8kAoZq7Ox7go
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
using System.CodeDom.Compiler; | |
using System.IO; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace IndentFail | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) |
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
using Greet; | |
using Grpc.Core; | |
namespace ClientApp | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
var channel = new Channel("localhost:50051", |
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 ChannelsQueue : IJobQueue<Action> | |
{ | |
private ChannelWriter<Action> _writer; | |
public ChannelsQueue() | |
{ | |
var channel = Channel.CreateUnbounded<Action>(); | |
var reader = channel.Reader; | |
_writer = channel.Writer; | |
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 Squares | |
{ | |
public static int Square(int i) => i * i; | |
public static int SumOfSquares(int i) => Enumerable.Range(1, i).Select(Square).Sum(); | |
} |
NewerOlder