Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Cazzulino kzu

View GitHub Profile
@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 / 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 / query
Created Jan 18, 2019
Query package dependencies
View query
query {
organization(login: "moq") {
repository(name: "moq") {
dependencyGraphManifests(withDependencies: true) {
nodes {
filename
dependencies {
nodes {
packageManager
packageName
@kzu
kzu / FormsTests.cs
Created Oct 18, 2018
Mocking Xamarin.Forms
View FormsTests.cs
public abstract class FormsTests
{
static FormsTests()
{
// Force loading of XAML assembly.
Debug.WriteLine(typeof(XamlCompilationAttribute).FullName);
var mock = new Mock<IPlatformServices> { DefaultValue = DefaultValue.Mock };
mock.Setup(x => x.BeginInvokeOnMainThread(It.IsAny<Action>()))
.Callback<Action>(action => action());