Skip to content

Instantly share code, notes, and snippets.

View WernerMairl's full-sized avatar

Werner Mairl WernerMairl

  • Vienna
View GitHub Profile
@WernerMairl
WernerMairl / program.cs
Created October 20, 2021 05:29
WebHost with Environment fix
var builder = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(
webBuilder =>
{
webBuilder
.UseStartup<Startup>()
.ConfigureAppConfiguration(app =>
{
var finding = app.Sources.Where(s => s is EnvironmentVariablesConfigurationSource).SingleOrDefault() as EnvironmentVariablesConfigurationSource;
if (finding != null)
@WernerMairl
WernerMairl / ExtendedEnvironmentVariablesConfigurationProvider.cs
Created October 20, 2021 05:17
Idea to solve Environemnt Issue with dot/underscore
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Generic;
namespace Microsoft.Extensions.Configuration.EnvironmentVariables
{
@WernerMairl
WernerMairl / Workshop.md
Last active December 30, 2020 09:31
BaseCamp Workshop Trailrunning Vienna

Workshop Garmin BaseCamp

1. Software downloaden und installieren

Die (Windows) Software von Garmin gibt es hier zum downloaden (~60MB): https://www8.garmin.com/support/download_details.jsp?id=4435

2. Eine Karte downloaden und installieren

"Alps" umfasst den ganzen Alpenbogen und ist ca 1.8 GB groß "Austria" umfasst nur Österreich und ist ca. 0.4 GB groß

@WernerMairl
WernerMairl / JsonConsoleLogger.json
Created August 13, 2020 17:39
JsonConsoleLoggerDemo
{
"Timestamp": null,
"EventId": 0,
"LogLevel": "Error",
"Category": "category",
"Message": "mystate",
"Exception": {
"Message": "Root",
"Type": "System.Exception",
"StackTrace": [
@WernerMairl
WernerMairl / appsettings.Development.json
Created January 23, 2020 17:53
development settings for Trail365
{
"RunMigrationsAtStartup": true,
"CloudStorageEnabled": false,
"CloudStorageRootContainerName": "uploads",
"FileSystemBlobServiceRootDirectory": "%LOCALAPPDATA%\\trail365\\localblob",
"FileSystemBlobServiceRequestPath": "/localblob",
"CloudStorageMaxAgeSeconds": -1,
2020-01-23T11:27:49.033982919Z Issue Sample App
2020-01-23T11:27:55.445397366Z info: Sample.Web.Startup[101]
2020-01-23T11:27:55.445436966Z Application started
2020-01-23T11:27:55.464208069Z Hosting environment: Production
2020-01-23T11:27:55.464294170Z Content root path: /app
2020-01-23T11:27:55.481498556Z Now listening on: http://[::]:80
2020-01-23T11:27:55.481954061Z Application started. Press Ctrl+C to shut down.
2020-01-23T11:31:32.324679042Z Issue Sample App
2020-01-23T11:31:33.939620199Z info: Sample.Web.Startup[101]
@WernerMairl
WernerMairl / program.cs
Created March 2, 2019 15:54
Create Jwt Bearer Token (sample)
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
using Microsoft.IdentityModel.Tokens;
namespace ConsoleApp1
{
class Program
{
using System;
using System.IO;
.....
[Fact]
public void CreationTimeUtc_Bug()
{
FROM openjdk:8-jdk-stretch
ENV PWSH_VERSION 6.0.4*
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils && apt-get install --no-install-recommends -y curl gnupg apt-transport-https \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list' \
&& apt-get update && apt-get install --no-install-recommends -y powershell=${PWSH_VERSION} \
&& rm -rf /var/lib/apt/lists/*