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 Xunit; | |
using System.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
namespace ProofOfConcept.ClearSingleton; | |
public sealed class Singleton : IDisposable | |
{ | |
private static Singleton? _instance; |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net7.0</TargetFramework> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="PSValueWildcard" Version="1.0.0-alpha1" /> |
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 BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System.Collections; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
namespace SingleCollectionBenchmark; | |
/// <summary> | |
/// <code> |
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
// See https://aka.ms/new-console-template for more information | |
using StrongInject; | |
using System.Net; | |
using System.Net.Http.Json; | |
namespace StrongInjectConfiguredHttpClientExample; | |
public class Program | |
{ | |
public async Task 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
// PowerShell continuation job allows you to subscribe a continuation to an existing job. | |
// The following example is a bit useless but demonstrates the functionality of the job. | |
// PS:\> function Register-ContinuationJob { param([Job]$Job, [ScriptBlock]$Continuation) process { $cont = [ContinuationJob]::new($Job, $Continuation); $PSCmdlet.JobRepository.Add($cont); $cont } | |
// PS:\> $WakeUpJob = Start-Job { while (-not (Test-Connection Server01 -Quiet -Count 1)) { Start-Sleep -Seconds 1 } } | |
// PS:\> $ShutdownJob = Register-ContinuationJob -Job $WakeUpJob -Continuation { Invoke-Command -computerName Server01 -ScriptBlock { 'Sending shut down' ; Stop-Computer } } | |
// PS:\> $WakeUpJob, $ShutdownJob | Receive-Job -Wait -AutoRemoveJob | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; |
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
[CmdletBinding(SupportsShouldProcess)] | |
param( | |
[Parameter(Mandatory)] | |
[string]$ModuleName, | |
[Parameter(Mandatory)] | |
[Alias('OutputPath')] | |
[string]$DestinationPath, | |
[switch]$NoBinaryProject, | |
[switch]$NoScriptProject, |
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.Generic; | |
using System.Linq; | |
using System.Management.Automation; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Casion.PowerShell | |
{ | |
/// <summary> |