Skip to content

Instantly share code, notes, and snippets.

Avatar

Paweł Haracz PawelHaracz

View GitHub Profile
@PawelHaracz
PawelHaracz / docker-dotnet-aspnet-https.md
Created Sep 3, 2018 — forked from richlander/docker-dotnet-aspnet-https.md
ASP.NET Core dotnet and docker commands for HTTPS
View docker-dotnet-aspnet-https.md
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword
dotnet dev-certs https --trust
docker pull microsoft/dotnet-samples:aspnetapp
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="crypticpassword" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ microsoft/dotnet-samples:aspnetapp
View dockerfile
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /app
EXPOSE 80
# copy csproj and restore as distinct layers
COPY src/nuget.config ./src/
COPY src/*.sln ./src/
COPY src/Qbank.Questions/*.csproj ./src/Qbank.Questions/
COPY src/Qbank.Questions.WebApi/*.csproj ./src/Qbank.Questions.WebApi/
COPY test/Qbank.Questions.Test/*.csproj ./test/Qbank.Questions.Test/
View Qbank-Mesh.json
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"registryPassword": {
"type": "SecureString"
View sync-functions-triggers.ps1
Invoke-AzureRmResourceAction -ResourceGroupName <your-resource-group> -ResourceType "Microsoft.Web/sites" -ResourceName <Your-Azure-Function> -Action syncfunctiontriggers -ApiVersion "2018-02-01" -Force
@PawelHaracz
PawelHaracz / AsyncHelper.cs
Created Jun 5, 2019
the validator checks whitelist and decodes token and compare this with appId claim;
View AsyncHelper.cs
public class AsyncHelper
{
private static readonly TaskFactory _myTaskFactory = new TaskFactory(CancellationToken.None,
TaskCreationOptions.None, TaskContinuationOptions.None, TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
{
var cultureUi = CultureInfo.CurrentUICulture;
var culture = CultureInfo.CurrentCulture;
return _myTaskFactory.StartNew(() =>
@PawelHaracz
PawelHaracz / AsyncHelper.cs
Last active Jun 5, 2019
the validator checks whitelist and decodes token and compare this with appId claim. An AsyncHelper invoke asynchronous method synchronously. A startup class is a normal .net core startup class
View AsyncHelper.cs
// Copyright (c) Microsoft Corporation, Inc. All rights reserved.
// Licensed under the MIT License, Version 2.0. See License.txt in the project root for license information.
/// <summary>
/// Helper created by microsoft
/// https://github.com/aspnet/AspNetIdentity/blob/master/src/Microsoft.AspNet.Identity.Core/AsyncHelper.cs
/// </summary>
public class AsyncHelper
{
View Wish.md

Merry Christmas and a Happy New Year!

I hope you will finish #25daysofserverless !!

View Authenticate-example.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Serverless Authentication</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<!-- Latest compiled and minified CSS -->
View C4Generator.cs
using Microsoft.Extensions.Options;
using Structurizr;
using Structurizr.Api;
namespace model.c4
{
public class C4Generator
{
private readonly Options.Structurizr _options;
private const string MicroserviceTag = "Microservice";
You can’t perform that action at this time.