Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Cazzulino kzu

View GitHub Profile
@kzu
kzu / ObservableDictionary.cs
Last active Jan 6, 2021
An ObservableDictionary<TKey, TValue>
View ObservableDictionary.cs
// Licensed by Daniel Cazzulino under the MIT License
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
using System.Text;
@kzu
kzu / azure_pipelines.yml
Created Sep 23, 2020
Visual Studio Preview in CI
View azure_pipelines.yml
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
- task: UseDotNet@2
inputs:
packageType: sdk
version: 3.1.x
performMultiLevelLookup: true
@kzu
kzu / CSharp.sbntxt
Created Sep 18, 2020
source-generators
View CSharp.sbntxt
/// <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 Jul 31, 2020
Central Package Versions
View Directory.Packages.props
<Project>
<ItemGroup>
<PackageReference Update="GitInfo" Version="2.0.20" PrivateAssets="all" />
<PackageReference Update="Newtonsoft.Json" DefaultVersion="12.0.3" />
</ItemGroup>
</Project>
@kzu
kzu / profiles.json
Last active Jul 22, 2020
Windows Terminal settings
View profiles.json
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{63661ee7-c8c4-434e-8579-f6112c77101f}",
"requestedTheme": "dark",
"profiles":
{
@kzu
kzu / X.Y.Z.Sources.csproj
Last active May 20, 2020 — forked from attilah/X.Y.Z.Sources.csproj
X.Y.Z.Sources nuget package
View X.Y.Z.Sources.csproj
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>contentFiles</ContentTargetFolders>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
@kzu
kzu / notnull.snippet
Last active Mar 25, 2020
ArgumentNullException C# Code Snippet
View notnull.snippet
<?xml version="1.0" encoding="utf-8" ?>
<!--
Template for a null check for a parameter.
Press notnull[TAB][TAB] to get it.
Copy to Documents\Visual Studio 2015\Code Snippets\Visual C#\My Code Snippets\notnull.snippet
Restart VS
-->
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
@kzu
kzu / IncludePackageReferenceInVSIX.targets
Last active Nov 28, 2019
Include nuget package reference assets in VSIX
View IncludePackageReferenceInVSIX.targets
<Project>
<Target Name="IncludePackageReferenceInVSIX"
Condition="$(CI)"
Inputs="@(PackageReference -> WithMetadataValue('IncludeInVSIX', 'true'))"
Outputs="%(PackageReference.Identity)"
DependsOnTargets="ResolvePackageAssets"
AfterTargets="ResolveReferences">
<PropertyGroup>
<IncludeInVSIXPackageId>%(PackageReference.Identity)</IncludeInVSIXPackageId>
</PropertyGroup>
@kzu
kzu / Program.cs
Last active Oct 31, 2019
Using SymSpell to detect 1-char misspellings without hardcoding gazzillion misspellings
View Program.cs
// Requires package reference to https://www.nuget.org/packages/symspell
using System;
using System.IO;
using System.Linq;
using System.Text;
class Program
{
static void Main(string[] args)
@kzu
kzu / home-end.ahk
Created Feb 2, 2018
Home/End AutoHotKey remap
View home-end.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#InstallKeybdHook
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; NoTrayIcon
; OPTIONAL: For those who use Home/End more than PgUp/PgDown, this flips their use with the Fn key.
; If you want the buttons to function as they are, add a semicolon (;) to the beginning of each line below.
Home::PgUp
End::PgDn
PgUp::Home