Skip to content

Instantly share code, notes, and snippets.

interface

7FF81390136B mov       rcx,[rsi+8]
7FF81390136F mov       r11,7FF8135903A8
7FF813901379 call      qword ptr [7FF8135903A8]

abstract

@usausa
usausa / Program.cs
Last active November 1, 2022 09:59
Microsoft.Data.Sqlite Mutlithread test
using System.CommandLine;
using System.CommandLine.NamingConventionBinder;
using System.Diagnostics;
using Microsoft.Data.Sqlite;
using Smart.Data.Mapper;
#pragma warning disable CA1812
@usausa
usausa / SlidingPager.cs
Created September 4, 2022 05:21
SlidingPager
public sealed class SlidingPager<T> : IList<T>
{
private readonly List<T> source;
private readonly Func<T, DateTime> selector;
private int end;
private int start;
@usausa
usausa / TimeAxisCalculator.cs
Last active August 30, 2022 10:48
AxisCalculator
public static class TimeAxisCalculator
{
private static readonly TimeSpan[] CandidateValues =
{
TimeSpan.FromMinutes(1),
TimeSpan.FromMinutes(2),
TimeSpan.FromMinutes(5),
TimeSpan.FromMinutes(10),
TimeSpan.FromMinutes(15),
TimeSpan.FromMinutes(30),
@usausa
usausa / ISectionCallback.cs
Last active June 28, 2022 04:58
Blazor section
public interface ISectionCallback
{
void SetMenu(RenderFragment value);
}
@usausa
usausa / LoadingOverlay.cs
Last active June 20, 2022 07:37
MAUI WindowOverlay
public sealed class LoadingOverlay : WindowOverlay
{
public LoadingOverlay(IWindow window)
: base(window)
{
AddWindowElement(new LoadingElementOverlay());
EnableDrawableTouchHandling = true;
}
private class LoadingElementOverlay : IWindowOverlayElement
@usausa
usausa / App.razor
Last active May 22, 2022 06:37
Blazor router
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<ExtendedErrorBoundary @ref="errorBoundary">
<ChildContent>
<ExtendedAuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" NotAuthorizedLayout="@typeof(ErrorLayout)">
<NotAuthorized>
@if (context.User.Identity?.IsAuthenticated != true)
{
<Server.Pages.Login Reload="true" />
<ItemGroup>
<Resource Include="App.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="appsettings.*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@usausa
usausa / Index.razor
Last active April 8, 2022 10:27
BusyState
@page "/"
<button class="btn btn-primary" @onclick="OnExecuteClock">Execute</button>
@code {
[CascadingParameter]
[AllowNull]
public ProgressState Progress { get; set; }
private async Task OnExecuteClock()
lang
  async
    async/await
    asynclocal
    awaiter
    calcellation
    channels
    configure-await
 continuations