Skip to content

Instantly share code, notes, and snippets.

View getSvgArcPath.js
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){
View waitElement.js
(async function() {
while(!document.querySelector("#yourElem")) {
await new Promise(r => setTimeout(r, 500));
}
)();
View EditResponseMiddleware.cs
public class EditResponseMiddleware
{
private readonly RequestDelegate _next;
public EditResponseMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext context)
@ffantasy
ffantasy / RSAKeyExtensions.cs
Last active Sep 27, 2020
export/import rsa
View RSAKeyExtensions.cs
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);
You can’t perform that action at this time.