Skip to content

Instantly share code, notes, and snippets.

View aetos382's full-sized avatar

aetos aetos382

View GitHub Profile
using System;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.UI.Xaml;
namespace Microsoft.Extensions.DependencyInjection;
internal static class WindowsAppServiceCollectionExtensions
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
@aetos382
aetos382 / Task.cs
Last active February 13, 2026 11:00
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
Console.WriteLine(await S());
Console.WriteLine(await T());
try
{
#!/usr/bin/env pwsh
#Requires -Module Microsoft.PowerShell.PSResourceGet
function Find-UpgradablePSResource {
param(
[string] $Repository = 'PSGallery',
[switch] $Prerelease)
$newestModules =
Get-Module -ListAvailable |
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
var span = "abcdefg".AsSpan();
var original = span;
Print(original);
Print(span + 1);
Print(span += 1);
@aetos382
aetos382 / AspNetCore1.cs
Last active February 25, 2026 04:40
ASP.NET Core の Program.cs の書き方の変遷
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using var host = new WebHostBuilder()
.ConfigureServices(static services =>
{
})
.Configure(static app =>
{
app.Use(static _ => static context => context.Response.WriteAsync("Hello, ASP.NET Core 1"));
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', 'AppPassword')]
param(
[Parameter(Mandatory)]
[string] $AccountHandle,
[Parameter(Mandatory)]
[string] $AppPassword)
function New-HashTag {
using System;
using System.Collections.Generic;
using System.Linq;
const int MaxAttempts = 100;
foreach (var s in GenerateDdsk().DoWhile(x => !x.LoveInjected).Take(MaxAttempts).Select(x => x.Ddsk))
{
Console.WriteLine(s);
}