Skip to content

Instantly share code, notes, and snippets.

View ffantasy's full-sized avatar

ffantasy

View GitHub Profile
@ffantasy
ffantasy / RSAKeyExtensions.cs
Last active September 27, 2020 13:52
export/import rsa
internal static class RSAKeyExtensions
{
#region JSON
internal static void FromJsonString(this RSA rsa, string jsonString)
{
Check.Argument.IsNotEmpty(jsonString, nameof(jsonString));
try
{
var paramsJson = JsonConvert.DeserializeObject<RSAParametersJson>(jsonString);
public class EditResponseMiddleware
{
private readonly RequestDelegate _next;
public EditResponseMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext context)
(async function() {
while(!document.querySelector("#yourElem")) {
await new Promise(r => setTimeout(r, 500));
}
)();
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
var angleInRadians = (angleInDegrees-90) * Math.PI / 180.0;
return {
x: centerX + (radius * Math.cos(angleInRadians)),
y: centerY + (radius * Math.sin(angleInRadians))
};
}
function getArcPath(centerX, centerY, radius, startAngle, endAngle){