Skip to content

Instantly share code, notes, and snippets.

@danielcrenna
danielcrenna / Program.cs
Last active March 30, 2024 20:01
Red Triangle using SILK.NET and SharpGLTF
using System.Numerics;
using System.Runtime.InteropServices;
using SharpGLTF.Geometry;
using SharpGLTF.Materials;
using Silk.NET.Input;
using Silk.NET.OpenGL;
using Silk.NET.Windowing;
using VERTEX = SharpGLTF.Geometry.VertexTypes.VertexPosition;
@danielcrenna
danielcrenna / EndpointTests.cs
Created March 5, 2021 18:18
ASP.NET Core: Show web application logs in in-memory integration tests
// Copyright (c) Daniel Crenna. All rights reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at http://mozilla.org/MPL/2.0/.
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Xunit;
@danielcrenna
danielcrenna / README.md
Last active July 23, 2020 09:00 — forked from fredeil/README.md
GitHub action for versioning your repository using NBGV

Simple versioning of your repository

Using NBGV to tag your master branch on push.

@danielcrenna
danielcrenna / Demo.csproj
Last active May 10, 2020 14:59
DI Source Generator
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0-preview.3.20215.2" />
</ItemGroup>
<ItemGroup>
@danielcrenna
danielcrenna / Add.cs
Last active February 21, 2020 05:03
[ActiveRoutes] Hello World
public static class Add
{
public static IMvcCoreBuilder AddRuntimeApi<T>(this IMvcCoreBuilder mvcBuilder, IConfiguration config)
{
mvcBuilder.Services.Configure<RuntimeOptions>(config, o => { o.BindNonPublicProperties = false; });
return mvcBuilder.AddActiveRoute<RuntimeController<T>, RuntimeFeature, RuntimeOptions>();
}
public static IMvcCoreBuilder AddRuntimeApi<T>(this IMvcCoreBuilder mvcBuilder,
@danielcrenna
danielcrenna / BenchmarkDotNet.md
Last active February 12, 2020 18:47
[TypeKitchen] Current Benchmarks
BenchmarkDotNet=v0.12.0, OS=Windows 10.0.18362
Intel Core i9-9820X CPU 3.30GHz, 1 CPU, 20 logical and 10 physical cores
.NET Core SDK=3.1.101
  [Host]     : .NET Core 3.1.1 (CoreCLR 4.700.19.60701, CoreFX 4.700.19.60801), X64 RyuJIT
  Job-VCJQXP : .NET Core 3.1.1 (CoreCLR 4.700.19.60701, CoreFX 4.700.19.60801), X64 RyuJIT

Runtime=.NET Core 3.1  
@danielcrenna
danielcrenna / Program.cs
Last active February 12, 2020 18:45
[TypeKitchen] Hello, World!
// Copyright (c) Daniel Crenna & Contributors. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace TypeKitchen.HelloWorld
{
internal class SimpleType
{
public string ThisIsAString { get; set; }
@danielcrenna
danielcrenna / Demo.csproj
Last active October 29, 2019 07:26
[Blowdart.UI] Hello, World
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blowdart.UI.Web" Version="0.0.3-pre" />
</ItemGroup>
@danielcrenna
danielcrenna / PackagePrep.csproj
Last active November 21, 2019 17:10 — forked from attilah/X.Y.Z.Sources.csproj
X.Y.Z.Sources nuget package (with pre-processor transformations support)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
</Project>
@danielcrenna
danielcrenna / Delta.cs
Created November 1, 2018 04:11 — forked from anonymous/Delta.cs
Simplified, single-class version of OData's Delta<T> built with FastMember
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using API.Infrastructure.Helpers.FastMember;
using ServiceStack;
namespace API.Infrastructure.Models
{
public class Delta<T> : DynamicObject where T : class