This file contains hidden or 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 namespace System.Threading.Channels; | |
public class MessageBus<T> | |
{ | |
private readonly Channel<T> channel = Channel.CreateUnbounded<T>(); | |
public void Subscribe(Action<T> handler) | |
{ | |
var reader = channel.Reader; | |
Task.Run(async () => |
This file contains hidden or 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
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get -y install git libicu-dev build-essential curl libunwind8 gettext nano lldb wget | |
wget https://download.visualstudio.microsoft.com/download/pr/d52fa156-1555-41d5-a5eb-234305fbd470/173cddb039d613c8f007c9f74371f8bb/dotnet-sdk-3.1.101-linux-arm.tar.gz | |
wget https://download.visualstudio.microsoft.com/download/pr/da60c9fc-c329-42d6-afaf-b8ef2bbadcf3/14655b5928319349e78da3327874592a/aspnetcore-runtime-3.1.1-linux-arm.tar.gz | |
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.1.101-linux-arm.tar.gz -C $HOME/dotnet | |
tar zxf aspnetcore-runtime-3.1.1-linux-arm.tar.gz -C $HOME/dotnet |
This file contains hidden or 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
/* | |
Usage: | |
client = new DocumentClient(new Uri(Endpoint), Key); | |
_clientEventListener = new DocumentClientEventListener(client); | |
CreateDatabaseIfNotExistsAsync().Wait(); | |
CreateCollectionIfNotExistsAsync().Wait(); | |
_clientEventListener.Initialize(); |
This file contains hidden or 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
FileHeader* one = stackalloc FileHeader[1]; | |
FileHeader* two = stackalloc FileHeader[1]; | |
if (!Win32Helper.TryReadFileHeader(one, "headers.one")) | |
throw new Win32Exception(); | |
if (!Win32Helper.TryReadFileHeader(two, "headers.two")) | |
throw new Win32Exception(); | |
var oneJson = RavenJObject.FromObject(*one); |
This file contains hidden or 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; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace InvalidProgramExceptionReproduction | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or 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 ConflictStatus GetConflictStatus(string remoteAsString, string localAsString) | |
{ | |
if (remoteAsString == localAsString) | |
return ConflictStatus.AlreadyMerged; | |
if(string.IsNullOrEmpty(remoteAsString)) | |
return ConflictStatus.AlreadyMerged; | |
if (string.IsNullOrEmpty(remoteAsString) || string.IsNullOrEmpty(localAsString)) | |
return ConflictStatus.Update; |