Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Andreas Ullrich dasMulli

  • Tieto Austria
  • Vienna, Austria
View GitHub Profile
@dasMulli
dasMulli / GitVersionedProject.csproj
Last active Mar 6, 2017
Demo of using Git branch with mapping + commit count to set version properties in csproj
View GitVersionedProject.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<GitBranchToReleaseLabelMapping Include="master" ReleaseLabel="rtm" />
<GitBranchToReleaseLabelMapping Include="develop" ReleaseLabel="beta" />
@dasMulli
dasMulli / TFSAggregatorPolicies.xml
Created Mar 24, 2017
Auto-activates and resolves work items when child work items change
View TFSAggregatorPolicies.xml
<rule name="AutoActivate" appliesTo="Task,User Story,Feature,Bug">
<![CDATA[
if((string)self["System.State"] == "Active")
{
string currentParentState = null;
var requirementTypeNames = new[] { "User Story", "Feature", "Epic" };
if(self.HasParent() && (currentParentState = (string)self.Parent["System.State"]) != "Active")
{
string reason;
if (requirementTypeNames.Contains(self.Parent.TypeName))
@dasMulli
dasMulli / ci-publish.proj.xml
Last active Apr 19, 2017
Publish (multiple) classic web application projects in multiple configurations to an output folder
View ci-publish.proj.xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- CONFIGURE the configurations to publish for here -->
<PropertyGroup>
<ConfigurationsToPublish>Release;CD;UAT;Customer1;Customer2</ConfigurationsToPublish>
</PropertyGroup>
<!-- CONFIGURE the web projects to publish here. -->
<ItemGroup>
@dasMulli
dasMulli / msbuild.sh
Last active May 9, 2017
Invokes msbuild with .net core sdk path on mac and linux. Copied with some edits from omnisharp-roslyn
View msbuild.sh
#!/usr/bin/env bash
DOTNET_CLI_PATH="$(dirname $(which dotnet))/sdk/$(dotnet --version)"
export MSBuildExtensionsPath="$DOTNET_CLI_PATH/"
export CscToolExe="$DOTNET_CLI_PATH/Roslyn/RunCsc.sh"
export MSBuildSDKsPath="$DOTNET_CLI_PATH/Sdks"
msbuild /nologo /v:minimal "$@"
@dasMulli
dasMulli / build-with-docker.sh
Last active Aug 7, 2017
Sample asp.net core / .net core build setup
View build-with-docker.sh
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
SRC_DIR="$(cd -P "$(dirname "$SOURCE")"&&pwd)"
WORKDIR="/usr/src"
IMAGENAME="microsoft/aspnetcore-build"
COMMAND="./build.sh"
docker pull "$IMAGENAME"
docker run --rm -w "$WORKDIR" -v "$SRC_DIR":"$WORKDIR" -- "$IMAGENAME" $COMMAND
@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)' == ''">
@dasMulli
dasMulli / NSObject+MethodBlockReplacement.Tests.m
Last active Apr 7, 2018
Method replacement - dynamic subclassing in objective c
View NSObject+MethodBlockReplacement.Tests.m
//
// InterceptionTests.m
//
// Created by Martin Ullrich on 19.07.13.
// Copyright (c) 2013 CSS Computer-Systems-Support GmbH. All rights reserved.
//
#import "InterceptionTests.h"
#import <RootKit/RootKit.h>
#import <objc/message.h>
@dasMulli
dasMulli / Directory.Build.targets
Last active Sep 2, 2018
PublishAll target to publish for all frameworks and runtimes
View Directory.Build.targets
<Project>
<Target Name="PublishProjectIfFrameworkSet"
DependsOnTargets="Publish"
Condition=" '$(TargetFramework)' != '' " />
<Target Name="PublishProjectForAllRIDsIfTargetFrameworkSet" Condition=" '$(TargetFramework)' != '' and '$(RuntimeIdentifiers)' != '' and '$(RuntimeIdentifier)' == '' ">
<ItemGroup>
<_PublishRuntimeIdentifier Include="$(RuntimeIdentifiers)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PublishAll" Properties="TargetFramework=$(TargetFramework);RuntimeIdentifier=%(_PublishRuntimeIdentifier.Identity)" />
@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 / webpack.config.js
Created Dec 11, 2017
Angular 5 webpack for SpaServices 2.0.0
View webpack.config.js
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
module.exports = (env) => {
// Configuration in common to both client-side and server-side bundles
const isDevBuild = !(env && env.prod);
const sharedConfig = {