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
class IgnoreNullMembersInExpectation : IEquivalencyStep | |
{ | |
public bool CanHandle(IEquivalencyValidationContext context, IEquivalencyAssertionOptions config) => | |
context.Expectation is null || | |
context.Expectation is ValueType == default; | |
public bool Handle(IEquivalencyValidationContext context, IEquivalencyValidator parent, IEquivalencyAssertionOptions config) => true; | |
} |
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
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic | |
RUN apt-get update | |
RUN apt-get install mc -y |
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; | |
using System.Collections.Concurrent; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Common | |
{ | |
public class LimitedLengthActionPool : IAsyncDisposable | |
{ |
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
# place this file to your prepository root, or set the your repository full path to $repositoriesRoot | |
$repositoriesRoot = Convert-Path . | |
$files = Get-ChildItem -Path $repositoriesRoot -Filter *.csproj -Recurse -File -Name | |
$commands = @() | |
foreach ($fileName in $files) { | |
$xml = [Xml](Get-Content "$repositoriesRoot\$fileName") | |
foreach ($item in $xml.SelectNodes("//PackageReference")) { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<clear /> | |
<rule name="HttpToHttpsRule" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{HTTPS}" pattern="^OFF$" /> |
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; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
namespace ApiModelingApp.Controllers | |
{ | |
[Route("api/generation")] | |
[ApiController] |
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
// # .htaccess content sample | |
// RewriteRule ^/apache-mod-rules-redirect/(.*) /redirected?id=$1 [L,R=302] | |
using (StreamReader apacheModRewriteStreamReader = | |
File.OpenText(".htaccess")) | |
{ | |
var options = new RewriteOptions() | |
.AddApacheModRewrite(apacheModRewriteStreamReader); | |
app.UseRewriter(options); |
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; | |
using System.Threading; | |
using GreenPipes; | |
using MassTransit; | |
namespace TestMassTransit | |
{ | |
public class VideoFileMessage | |
{ | |
public int Num { get; set; } |
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
function timeout(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
let result = (async function() { | |
await timeout(3000); | |
console.log("done"); | |
})(); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!--- | |
config based on | |
https://blogs.msdn.microsoft.com/friis/2016/08/25/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world-apps/ | |
https://blogs.msdn.microsoft.com/friis/2016/08/25/iis-with-url-rewrite-as-a-reverse-proxy-part-2-dealing-with-500-52-status-codes/ | |
To you this configs you need to add | |
HTTP_ACCEPT_ENCODING | |
HTTP_X_ORIGINAL_ACCEPT_ENCODING |