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
([\w._]+)\.Should\(\)\.NotBeNull\(\) | |
Assert.NotNull($1) | |
([\w._]+)\.Should\(\)\.NotBeEmpty\(\) | |
Assert.NotEmpty($1) | |
([\w.!_]+)\.Should\(\)\.Be\(([\w.!_" ]+)\) | |
Assert.Equal($2, $1) | |
([\w._]+)\.Should\(\)\.BeTrue\(\) |
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
[MemoryDiagnoser] | |
public class BenchmarkSwitch | |
{ | |
[Params(typeof(int), typeof(DateTimeOffset), typeof(TimeSpan))] | |
public Type TargetType { get; set; } = typeof(int); | |
[Benchmark(Baseline = true)] | |
public int BaseLineBenchmark() | |
{ | |
if (TargetType == typeof(string)) |
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 readonly struct ConcurrencyToken : IEquatable<ConcurrencyToken> | |
{ | |
public static readonly ConcurrencyToken None = new(Array.Empty<byte>()); | |
public byte[] Value { get; } | |
public ConcurrencyToken(byte[] value) | |
{ | |
Value = value ?? Array.Empty<byte>(); | |
} |
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 Program | |
{ | |
public static int Main(string[] args) | |
{ | |
// azure home directory | |
var homeDirectory = Environment.GetEnvironmentVariable("HOME") ?? "."; | |
Log.Logger = new LoggerConfiguration() | |
.MinimumLevel.Verbose() | |
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
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.Text; | |
using System.Text.Json; | |
using Microsoft.AspNetCore.Mvc.Infrastructure; | |
namespace Demo.Middleware; | |
public class HostDebuggerOptions | |
{ | |
public string RouteDebuggerPath { get; set; } = "/route-debugger"; |
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
apk add --no-cache python3 py3-pip | |
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | |
chmod +x speedtest-cli | |
python3 speedtest-cli |
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
trigger: | |
- main | |
- develop | |
- releases/* | |
variables: | |
major: 1 | |
minor: 0 | |
name: $(major).$(minor).$(Rev:r) |
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 AssemblyMetadata | |
{ | |
private static readonly Lazy<string> _fileVersion = new(() => | |
{ | |
var assembly = typeof(AssemblyMetadata).Assembly; | |
var attribute = assembly.GetCustomAttribute<AssemblyFileVersionAttribute>(); | |
return attribute?.Version; | |
}); | |
private static readonly Lazy<string> _assemblyVersion = new(() => |
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
CREATE PROCEDURE [dbo].[ClientHierarchy] | |
@clientId UNIQUEIDENTIFIER | |
AS | |
DECLARE @root UNIQUEIDENTIFIER; | |
-- step 1, find hightest node | |
WITH ParentCTE (Id, ParentClientId) AS | |
( |
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
# EditorConfig is awesome: https://EditorConfig.org | |
root = true | |
# All Files | |
[*] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 4 | |
insert_final_newline = true |
NewerOlder