Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Andreas Ullrich dasMulli

  • Tieto Austria
  • Vienna, Austria
View GitHub Profile
@dasMulli
dasMulli / Directory.Build.targets
Last active Nov 6, 2020
TFM based feature flags as compiler constants
View Directory.Build.targets
<Project>
<ItemGroup>
<FeatureFlag Include="SUPPORTS_ECDSA" MinimumTargetFrameworks="netstandard1.6;net47" />
<FeatureFlag Include="SUPPORTS_GENERIC_HOST" MinimumTargetFrameworks="netcoreapp2.2;netstandard2.1" />
<FeatureFlag Include="SUPPORTS_SERVICE_PROVIDER_IN_HTTP_MESSAGE_HANDLER_BUILDER" MinimumTargetFrameworks="netcoreapp2.2;netstandard2.1" />
<FeatureFlag Include="SUPPORTS_CERTIFICATE_HASHING_WITH_SPECIFIED_ALGORITHM" MinimumTargetFrameworks="netcoreapp2.1;netstandard2.1;net48" />
</ItemGroup>
<!--
@dasMulli
dasMulli / Directory.Build.targets
Created Oct 17, 2020
Compiler consant for minimum framework version
View Directory.Build.targets
<Project>
<!--
neeeds to be in Directory.Build.targets to be included
after SDK's TargetFrameworkIdentifier/-Version inference
-->
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NetCoreApp'
and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '5.0'))">
<DefineConstants>$(DefineConstants);AT_LEAST_NET5_0</DefineConstants>
</PropertyGroup>
</Project>
@dasMulli
dasMulli / traversal.proj
Created Jun 4, 2020
Traversal project
View traversal.proj
<Project>
<ItemGroup>
<Projects Include="$(MSBuildStartupDirectory)\**\*.*proj" />
</ItemGroup>
<Target Name="VSTest">
<Message Importance="High" Text="Found project: %(Projects.Identity)" />
<MSBuild Projects="@(Projects)" Targets="VSTest" BuildInParallel="true" SkipNonexistentTargets="true" />
</Target>
<Target Name="Restore">
<Message Importance="High" Text="Found project: %(Projects.Identity)" />
@dasMulli
dasMulli / ns.cmd
Created Feb 25, 2020
Kubernetes namespace switching utility for Windows
View ns.cmd
@echo off
if "%~1"=="" GOTO PRINTNAMESPACE
: SETNAMESPACE
kubectl config set-context --current --namespace="%~1"
: PRINTNAMESPACE
@dasMulli
dasMulli / profiles.json
Created Sep 16, 2019
Windows Terminal config with VS 2019 Devekioer Command Prompt / PowerShell
View profiles.json
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"initialCols" : 160,
"initialRows" : 40,
"keybindings" :
[
{
@dasMulli
dasMulli / HardwareIntrinsics-DotNetMeetupVienna.pptx
Last active Aug 23, 2019
Hardware Intrinsics Talk for .NET Meetup Vienna August 2019
@dasMulli
dasMulli / MemoryLeakWorkaroundViewCell.cs
Created Jun 7, 2019
Xamarin.Forms UWP ListView memory leak workaround
View MemoryLeakWorkaroundViewCell.cs
using Xamarin.Forms;
public class MemoryLeakWorkaroundViewCell : ViewCell
{
protected override void OnDisappearing()
{
base.OnDisappearing();
base.Parent = null;
}
}
View CountTruesBenchmark.cs
public class CountTruesBenchmarks
{
private readonly bool[] boolArray;
public CountTruesBenchmarks()
{
var rnd = new Random(42);
boolArray = Enumerable.Range(0, 500).Select(_ => rnd.NextBoolean()).ToArray();
}
@dasMulli
dasMulli / Readme.md
Last active Dec 12, 2018
What's new in .NET Core 3.0?
View Readme.md

What's new in .NET Core 3.0?

Talk for the Vienna .NET User Group Meetup on Dec. 11th 2018.

License: MIT, based on dotnet-presentations/home presentations

@dasMulli
dasMulli / update.targets.xml
Created Feb 3, 2018
Update all package references
View update.targets.xml
<Project>
<Target Name="_CollectPackagesToUpdate" Returns="@(_PackageToUpdate)">
<ItemGroup>
<_PackageToUpdate Include="@(PackageReference)" Condition="'%(PackageReference.IsImplicitlyDefined)' != 'true' and '%(PackageReference.DoNotUpdate)' != 'true'"
TargetFramework="$(TargetFramework)" />
</ItemGroup>
</Target>
<Target Name="_UpdatePackagesSingleTfm" DependsOnTargets="_CollectPackagesToUpdate" Condition="'$(TargetFramework)' != '' and '$(TargetFrameworks)' == ''">