Это пошаговое руководство о том, как включить автоматическое подписание Git-коммитов с помощью GPG для всех приложений, которые не поддерживают его изначально (например: GitHub Desktop, JetBrains Rider, ...)
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
// C#9 | |
using System; | |
using System.Collections.Generic; | |
foreach (var (value, index) in 5..10) | |
{ | |
Console.WriteLine($"Value = {value.ToString()}, Index = {index.ToString()}"); | |
} | |
public static class RangeExtensions |
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 class ExceptionExtensions | |
{ | |
public static List<Exception> FlattenInnerExceptions(this Exception exception) | |
{ | |
return exception | |
.DepthFirstSearchInnerExceptions() | |
.Distinct() | |
.Reverse() | |
.ToList(); | |
} |
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.Text.Json; | |
using System.Text.Json.Serialization; | |
namespace Core.Json.Converters | |
{ | |
public class JsonTimeSpanConverter : JsonConverter<TimeSpan> | |
{ | |
public bool WithoutSeconds { get; init; } |
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.Threading.Tasks; | |
namespace RetryPolicy | |
{ | |
/// <summary> | |
/// A class that can execute a specific code block multiple times, using linear retries. | |
/// </summary> | |
internal class LinearRetryPolicy<TResult> | |
{ |
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.Collections; | |
using System.Collections.Generic; | |
namespace DotNetDesignPatternDemos.Structural.Proxy | |
{ | |
class Creature | |
{ | |
public byte Age; | |
public int X, Y; | |
} |
Based on the materials of YouTube video by Nick Chapsas
(@Elfocrash)
This attribute indicates to the source code generator the type and its method in which certain methods specified in the Intercepted<TInterception, TReturn>
arguments should be intercepted
The source code generator can get the following data from this data:
- Line numbers and the path to the file containing this type;
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.Runtime.InteropServices; | |
using System.Collections.Concurrent; | |
using System.Diagnostics; | |
namespace Utilities.Common.Telemetry; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
/// <summary> | |
/// Provides extension methods for IServiceCollection to add an activity source factory. |