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
// requires that you're already using the actor source generator package | |
public static class TypedActorProxyFactory | |
{ | |
private static readonly FrozenDictionary<Type, string> Map; | |
static TypedActorProxyFactory() | |
{ | |
Map = (from Assembly e in AppDomain.CurrentDomain.GetAssemblies() | |
where e.FullName is not null && !e.FullName.StartsWith("System.") // skip dynamic and coreclr assemblies |
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 Aspire.Hosting.Azure; | |
using System.Text.Json; | |
var builder = DistributedApplication.CreateBuilder(args); | |
var eh = builder.AddAzureEventHubs("eh") | |
.RunAsEmulator() | |
.AddEventHub("hub1"); | |
builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>( |
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
# Clear-Host | |
Import-Module Pester | |
# New-Item -ItemType Directory 'a/b' -Force -ErrorAction Ignore | |
# New-Item -ItemType Directory 'c' -Force -ErrorAction Ignore | |
# New-SmbShare -Name "Shared" -Path "./shared" -FullAccess "Everyone" | |
$ErrorActionPreference = 'Stop' | |
$PesterPreference = [PesterConfiguration]::Default | |
$PesterPreference.Output.StackTraceVerbosity = 'None' |
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
# demonstrate using a nested dispatcher frame to avoid blocking powershell thread | |
# this way you can have full "floating" windows manageable interactively in MTA mode (default) powershell | |
# Oisin/x0n - feb 9, 2009 | |
Set-StrictMode -Version latest | |
$ps = [powershell]::create() | |
$rs = [runspacefactory]::createrunspace() | |
$rs.ApartmentState = "STA" |
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.Linq; | |
using System.Management.Automation; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Casion.PowerShell | |
{ | |
/// <summary> |
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
[cmdletbinding()] | |
param([switch]$Preview) | |
# vswhere will reliably locate visual studio installations | |
if (!(gcm vswhere)) { | |
# https://chocolatey.org/ | |
if (gcm choco) { | |
choco install vswhere -y | |
} | |
else { |
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
Verifying that +oising is my blockchain ID. https://onename.com/oising |
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
internal class CodeBlockWithTimeout<TResult> | |
{ | |
private readonly Func<TResult> _block; | |
private readonly string _name; | |
private CodeBlockWithTimeout(Func<TResult> block, string name) | |
{ | |
this._block = block; | |
_name = name; |