This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory = $True, Position=1)][string]$BaseUrl | |
) | |
function Get-Json { | |
Param([string]$json, [string]$key) | |
ConvertFrom-Json $json | Select-Object -expand $key | |
} | |
$configuration = Invoke-WebRequest -ContentType "application/json" -Uri "$BaseUrl/.well-known/openid-configuration" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() { | |
echo "Usage: $0" | |
echo " <file>.cer - Windows certificate file .cer format." | |
echo " <file> - File name generated .crt. Default to <file>.crt." | |
exit 1 | |
} | |
if [ -z "$1" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Text; | |
using System.Xml; | |
using System.Xml.Serialization; | |
namespace ConsoleAppXml | |
{ | |
internal class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Nordax.NServiceBus { | |
/// <summary> | |
/// Behavior that wraps invocation of pipeline with a scoped service provider. | |
/// </summary> | |
internal sealed class ScopedServiceBehavior : Behavior<IIncomingPhysicalMessageContext> | |
{ | |
/// <summary> | |
/// Registered behavior with name. | |
/// </summary> | |
public const string StepId = "ScopedService"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <inheritdoc /> | |
/// <summary> | |
/// Extract the EventId.Id value from <see cref="Microsoft.Extensions.Logging.EventId" /> passed with | |
/// <see cref="Microsoft.Extensions.Logging" /> and set the <c>Event ID</c> field in Windows Event Log. | |
/// </summary> | |
/// <remarks> | |
/// <para> | |
/// Serilog creates an <see cref="Serilog.Events.LogEventPropertyValue" /> with two | |
/// <see cref="Serilog.Events.ScalarValue" /> combined into | |
/// <see cref="Serilog.Events.StructureValue" />. One <c>ScalarValue</c> has the actual id with the key <c>Id</c> and the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin" | |
# "C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\" | |
# Taken from psake https://github.com/psake/psake | |
<# | |
.SYNOPSIS | |
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode | |
to see if an error occcured. If an error is detected then an exception is thrown. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%~1"=="" ( | |
set /p "migration=Migration name is required. Enter name: " | |
) | |
if "%migration%"=="" ( exit /b ) | |
set "filepath=%~2" | |
REM Content file is just one line as "-c MyDdContext -p Path/To/Project.csproj -o Path/To/Migrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Model to work with a subset of a set and render charts and graphs correctly. | |
/// </summary> | |
public class PartialSetSlicer | |
{ | |
/// <summary> | |
/// Construct a <see cref="PartialSetSlicer" /> with <see cref="Threshold" /> set to the distribution of the last element. | |
/// </summary> | |
/// <param name="set">Data set.</param> | |
/// <param name="size">Size for subset.</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using MediatR; | |
namespace TestingMediatR | |
{ | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dir=/var/<app> | |
src=/home/user/vstsagent/_work/r1/a/<app>/drop/<app>.zip | |
service=<app>.service | |
# Clear directory | |
echo "Remove content from '$dir'" | |
rm -r $dir >> /dev/null |
NewerOlder