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 | |
if [ -z "$1" ]; then | |
echo "$0 username" | |
exit 1 | |
fi | |
KEY='./user.key' | |
CERT='./user.csr' | |
B64='./user.base64' | |
# The extra / is for bash on Windows, remove it on Linux | |
SUBJ="//CN=$1" |
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
private static void DumpDataTable(DataTable dt) | |
{ | |
if((dt == null) || (!SqlHelper.HasRows(dt))) | |
{ | |
Console.Error.WriteLine("There are no rows"); | |
} else | |
{ | |
foreach(DataColumn c in dt.Columns) | |
{ | |
Console.Write($"\"{c.ColumnName}\","); |
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 Microsoft.VisualStudio.TestTools.UnitTesting; | |
// using Newtonsoft.Json; | |
// using System; | |
// using System.Collections.Generic; | |
// using System.Linq; | |
/// <summary> | |
/// Tests that a model serializes correctly | |
/// </summary> | |
/// <typeparam name="T">Type</typeparam> |
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
// NuGet: Elastic.Apm | |
using Blitzkrieg.ElasticApmHelper; | |
using Elastic.Apm.Api; | |
// ... | |
namespace Blitzkrieg.DemoWeb { | |
public class ValuesController : ApiController | |
{ | |
private Libs.ElasticWrapper alm = new ElasticWrapper(); |
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 Elastic.Apm.Api; | |
// NuGet: Elastic.Apm | |
namespace Blitzkrieg.ElasticApmHelper { | |
/// <summary> | |
/// Elastic Wrapper | |
/// </summary> | |
public class ElasticWrapper |
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> | |
/// Handy Helper to Time Executions of Tests | |
/// <example> | |
/// Here is a typical snippet, because the class supports <see cref="IDisposable"/> the time can be started at the top | |
/// of the using statement and automatically stopped in the dispose | |
/// <code> | |
/// // Stop Watch Created and Started | |
/// using (TxTimer myTimer = new TxTimer( ... )) { | |
/// // Do something you want timed | |
/// var elapsed = myTimer.ElapsedMilliseconds; |
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> | |
/// MsTestLogger<typeparamref name="T"/> for ILogger | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public class MsTestLogger<T> : ILogger<T>, IDisposable | |
{ | |
private TestContext _output; | |
public MsTestLogger(TestContext output) | |
{ |
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> | |
/// Helpers to do asserts on objects in bulk | |
/// </summary> | |
public static class AssertHelpers | |
{ | |
#region "Serialization Helper" | |
/// <summary> | |
/// XUnit Tests that a model serializes correctly | |
/// </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
/// <summary> | |
/// Helper to output as JSON | |
/// </summary> | |
public static class TestOutputHelper | |
{ | |
/// <summary> | |
/// Emit an object as json | |
/// </summary> | |
/// <param name="output">ITestOutputHelper</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.Net; | |
using System.Net.Mail; | |
namespace testemail | |
{ | |
public static class SendMailer | |
{ | |
public static void SendMail(EmailDTO dto) | |
{ | |
SmtpClient client = new SmtpClient(dto.address); |
NewerOlder