Skip to content

Instantly share code, notes, and snippets.

View kzu's full-sized avatar
💜
Attempt #2 at OSS sustainability with SponsorLink 💜

Daniel Cazzulino kzu

💜
Attempt #2 at OSS sustainability with SponsorLink 💜
View GitHub Profile
@kzu
kzu / ChatClientTypedExtensions.cs
Created October 9, 2024 21:12
Typed extension for ChatClient
// <auto-generated />
#region License
// MIT License
//
// Copyright (c) Daniel Cazzulino
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@kzu
kzu / gh-graphql.css
Created April 11, 2024 15:16
GitHub GraphQL API Explorer Full Screen
[data-container=nav] {
display: none !important;
}
footer {
display: none !important;
}
#main-content .container-xl {
max-width: unset;
@kzu
kzu / throwing
Created September 24, 2023 22:39
Try to inspect variables when the exception is thrown
using Spectre.Console;
Console.WriteLine("Hello, World!");
for (int i = 0; i < 50; i++)
{
var result = await AnsiConsole.Status().StartAsync("Processing", async c =>
{
await Task.Delay(i);
if (i == 2)
@kzu
kzu / ComponentAttribute.cs
Created October 20, 2022 15:08
A sample code generator that emits export + export metadata annotations
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true, Inherited = false)]
public abstract class ComponentAttribute : ExportAttribute
{
protected ComponentAttribute() { }
protected ComponentAttribute(Type contractType) : base(contractType) { }
protected ComponentAttribute(string contractName) : base(contractName) { }
@kzu
kzu / cla.md
Created August 12, 2022 18:08
CLA

Contribution License Agreement

This Contribution License Agreement (“Agreement") is agreed to by the party signing below ("You"), and conveys certain license rights to Daniel Cazzulino, Devlooped and Clarius Foundation ("Organization") for Your contributions to the Organization open source projects. This Agreement is effective as of the latest signature date below.

1. Definitions.

"Code" means the computer software code, whether in human-readable or machine-executable form,

817 ERROR System.ArgumentException: The supplied SnapshotPoint is on an incorrect snapshot. at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) Editor or Editor Extension 2022/02/02 15:20:07.294
818 ERROR System.ArgumentException: The supplied SnapshotPoint is on an incorrect snapshot. at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.ValidateBufferPosition(SnapshotPoint bufferPosition) at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.Microsoft.VisualStudio.Text.Editor.IWpfTextView.GetTextViewLineContainingBufferPosition(SnapshotPoint bufferPosition) at Microsoft.VisualStudio.Internal.InlineSuggestions.Implementation.SuggestionSession.GenerateTags(SuggestedEdit edit, String suffix, List`1& intraTextAdornmentTags, List`1& interLineAdornmentTags) in D:\a\_work\1\s\src\InlineSuggestions\Implementation\SuggestionSession.cs:line 558 at Microsoft.
@kzu
kzu / setup.cmd
Last active November 29, 2021 19:57
kzu devenv
rem https://github.com/microsoft/winget-cli/releases
rem iwr -useb get.scoop.sh | iex
rem iwr -useb https://community.chocolatey.org/install.ps1 | iex
rem ensure winget settings has experimentalFeatures.experimentalMSStore = true
rem see https://www.thomasmaurer.ch/2021/01/install-apps-from-the-microsoft-store-using-winget/
scoop bucket add extras
scoop bucket add github-gh https://github.com/cli/scoop-gh.git
@kzu
kzu / azure_pipelines.yml
Created September 23, 2020 19:21
Visual Studio Preview in CI
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
- task: UseDotNet@2
inputs:
packageType: sdk
version: 3.1.x
performMultiLevelLookup: true
@kzu
kzu / CSharp.sbntxt
Created September 18, 2020 13:00
source-generators
/// <summary>
/// Provides access to the current assembly information as pure constants,
// without requiring reflection.
/// </summary>
partial class ThisAssembly
{
/// <summary>
/// Gets the assembly metadata.
/// </summary>
public static partial class Metadata
@kzu
kzu / Directory.Packages.props
Created July 31, 2020 02:16
Central Package Versions
<Project>
<ItemGroup>
<PackageReference Update="GitInfo" Version="2.0.20" PrivateAssets="all" />
<PackageReference Update="Newtonsoft.Json" DefaultVersion="12.0.3" />
</ItemGroup>
</Project>