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
$filePath = "C:\path\to\your\file.txt" | |
$outputPath = "C:\path\to\output\encodedFile.txt" | |
# Read the file content as bytes | |
$fileContent = [System.IO.File]::ReadAllBytes($filePath) | |
# Convert the byte array to a Base64 string | |
$base64String = [Convert]::ToBase64String($fileContent) | |
# Output the Base64 string to a new file |
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.Collections; | |
using AutoFixture.Kernel; | |
public class GenerationDepthBehavior : ISpecimenBuilderTransformation | |
{ | |
private const int DefaultGenerationDepth = 1; | |
private readonly int _generationDepth; | |
public GenerationDepthBehavior(int generationDepth = DefaultGenerationDepth) | |
{ |
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.Extensions.Logging; | |
using Moq; | |
public static class MockLogger | |
{ | |
public static Mock<ILogger<T>> Create<T>() | |
{ | |
var mock = new Mock<ILogger<T>>(); | |
mock.Setup(l => l.IsEnabled(It.IsAny<LogLevel>())).Returns(true); | |
return mock; |
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
& 'C:\Program Files\7-Zip\7z.exe' a dest.zip . -r "-x!.git" "-x!.terraform" | |
& 'C:\Program Files\7-Zip\7z.exe' a dest.zip MyFolder\ -r -x!bin -x!obj |
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.Linq.Expressions; | |
using AutoFixture; | |
public static class AutoFixtureExtensions | |
{ | |
public static FixtureCustomization<T> For<T>(this Fixture fixture) => new(fixture); | |
public class FixtureCustomization<T>(Fixture fixture) | |
{ | |
public FixtureCustomization<T> With<TProp>(Expression<Func<T, TProp>> expr, TProp value) |
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
concurrent = 5 | |
check_interval = 0 | |
connection_max_age = "15m0s" | |
shutdown_timeout = 0 | |
[session_server] | |
session_timeout = 1800 | |
[[runners]] | |
name = "gitlab-runner01" |
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.Reflection; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
namespace Example; | |
public static class ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddImplementedInterfacesAsScoped( | |
this IServiceCollection services, |
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.Collections.Immutable; | |
using AutoFixture.Kernel; | |
public class ImmutableListSpecimenBuilder : ISpecimenBuilder | |
{ | |
public object Create(object request, ISpecimenContext context) | |
{ | |
if (context == null) | |
{ | |
throw new ArgumentNullException(nameof(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
[extend] | |
useDefault = true | |
[allowlist] | |
description = "Fake secrets" | |
regexTarget = "match" | |
regexes = [ | |
"6a654835c594485b8980ba2c73af6f18" | |
] |
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
resource natGateway 'Microsoft.Network/natGateways@2023-11-01' = if (hasNatGateway) { | |
name: natGatewayName | |
location: location | |
sku: { | |
name: 'Standard' | |
} | |
} | |
resource subnets 'Microsoft.Network/virtualNetworks/subnets@2022-11-01' = { | |
name: name |
NewerOlder