This file contains hidden or 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.Text; | |
namespace ConsoleApp1 | |
{ | |
public static class Columnizer | |
{ | |
public static IEnumerable<string> Columnize(IList<string> headers, IList<string[]> rows, string separator = " ") | |
{ | |
// Start with the lengths of the column headers | |
int[] columnWidths = headers |
This file contains hidden or 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; | |
/* | |
Example 1 | |
input : nums = [2,4,2,2,7,5,6,7,8,6,6,2,6,7,6] | |
output : nums = [2,4,5,6,8,6] | |
Example 2 input : nums = [2,2,3,2,3,2] | |
output : nums = [2,3,3] |
This file contains hidden or 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.Collections.Generic; | |
public static class IDictionaryExtensions | |
{ | |
public static bool TryGetValue<TKey, TOutValue, TInValue>(this IDictionary<TKey, TInValue> source, TKey key, out TOutValue value) | |
where TInValue : TOutValue | |
{ | |
if (source.TryGetValue(key, out var temp)) | |
{ | |
value= temp; |
This file contains hidden or 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.Runtime.CompilerServices; | |
namespace Extensions.Core; | |
public static class AsyncEnumerableExtensions | |
{ | |
public static async IAsyncEnumerable<T[]> BatchAsync<T>( | |
this IAsyncEnumerable<T> source, | |
int batchSize, | |
[EnumeratorCancellation] CancellationToken cancellationToken = default) |
This file contains hidden or 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 | |
mkdir -p ping-logs | |
filename=ping-logs/$(date +"%m-%d-%Y %T")_internet.log | |
echo $filename | |
ping www.google.com | while read endlooop; do echo "$(date): $endlooop"; done | tee "$filename" |
This file contains hidden or 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; | |
namespace Foo | |
{ | |
/// <summary> | |
/// Simple wrapper to add a timestamp to another item. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public class Timestamped<T> | |
{ |
This file contains hidden or 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 ClickHouse.Ado; | |
using System; | |
using System.Data; | |
namespace ClickHouseTest | |
{ | |
class Program | |
{ | |
static ClickHouseConnectionSettings connectionSettings = new ClickHouseConnectionSettings("xxxxx"); | |
This file contains hidden or 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
kubectl get certificaterequest | |
kubectl describe certificaterequest X | |
kubectl get order | |
kubectl describe order X | |
kubectl get challenge | |
kubectl describe challenge X |
This file contains hidden or 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.Diagnostics; | |
using System.Linq; | |
using System.Security.Cryptography; | |
namespace SymmetricKeyTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains hidden or 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.Security.Cryptography; | |
using Xunit; | |
namespace TpmTest.Tests | |
{ | |
public class StandaloneRsaTests | |
{ | |
[Fact] | |
public void Test() | |
{ |