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.Security.Cryptography; | |
using System.Xml; | |
namespace RSACryptoServiceProviderExtensions | |
{ | |
public static class RSACryptoServiceProviderExtensions | |
{ | |
public static void FromXmlString(this RSACryptoServiceProvider rsa, string xmlString) | |
{ |
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.Diagnostics; | |
namespace Profiler | |
{ | |
using Serilog; | |
using Serilog.Events; | |
public class OperationLogger : Stopwatch, IDisposable | |
{ |
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 GraphQL; | |
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
using System.Reflection; | |
namespace Extensions | |
{ | |
public static class ObjectExtensions | |
{ | |
public static T ToObject<T>(this IDictionary<string, object> dict) |
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
//Article about TOTP on my blog https://stapp.space/generate-totp-in-postman/ | |
/** | |
* @preserve A JavaScript implementation of the SHA family of hashes, as | |
* defined in FIPS PUB 180-4 and FIPS PUB 202, as well as the corresponding | |
* HMAC implementation as defined in FIPS PUB 198a | |
* | |
* Copyright Brian Turek 2008-2017 | |
* Distributed under the BSD License | |
* See http://caligatio.github.com/jsSHA/ for more information |
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
find . -name "*.csproj" -exec sed -b -i "s,<TargetFramework>[^<]*</TargetFramework>,<TargetFramework>netcoreapp3.1</TargetFramework>," {} \; |
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.Configuration; | |
using System.Net; | |
using System.Net.Http; | |
using System.Security.Cryptography.X509Certificates; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace Something |
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
for dir in */; do (cd "$dir" && <your_cmd_here>); done | |
#For example could be a git command. | |
#for dir in */; do (cd "$dir" && git pull); done |
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.Text.Json.Serialization | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers().AddJsonOptions(opts => | |
opts.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter())); | |
} |
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.AspNetCore.Http; | |
using Microsoft.AspNetCore.Http.Features; | |
using System; | |
using System.Diagnostics.CodeAnalysis; | |
using System.IO; | |
using System.Threading.Tasks; | |
namespace Starbucks.CustomerEngagement.Serilog.Enrichers.Tests | |
{ |
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. | |
# Author: wind.TWD@gmail.com | |
# Description: Used to replace exported Apigee proxy with expected pipeline tokens. Can be a pre-commit githook. | |
# Notes: | |
# Generally I wouldn't parse XML/HTML with regex, use xmlstarlet, but whatever. | |
# Can run the commands without the -i to test. | |
blue="\e[104m" | |
normal=$(tput sgr0) | |
proxy_name="PROXY_NAME" |
OlderNewer