Skip to content

Instantly share code, notes, and snippets.

Paweł Haracz PawelHaracz

  • Warsaw
Block or report user

Report or block PawelHaracz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
{
@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(() =>
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
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 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/
@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
You can’t perform that action at this time.