Skip to content

Instantly share code, notes, and snippets.

View meixger's full-sized avatar
💭
🚴‍♂️

Martin Meixger meixger

💭
🚴‍♂️
View GitHub Profile
@cajuncoding
cajuncoding / SystemTextJsonNodeMergeExtensions.cs
Last active July 12, 2024 04:36
Simple Merge process for JsonNode using System.Text.Json
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Nodes;
namespace CajunCoding
{
public static class SystemTextJsonMergeExtensions
{
@ayende
ayende / LetsEncryptClient.cs
Created January 11, 2018 22:26
ACME v2 client for Let's Encrypt
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@sniffdk
sniffdk / ContextHelpers.cs
Last active February 28, 2022 10:03
Fake an UmbracoContext for use when doing published scheduling or other scenarios where UmbracoContext is normally null.
public class ContextHelpers
{
public static UmbracoContext EnsureUmbracoContext() {
if (UmbracoContext.Current != null)
{
return UmbracoContext.Current;
}
var httpContext = new HttpContextWrapper(HttpContext.Current ?? new HttpContext(new SimpleWorkerRequest("temp.aspx", "", new StringWriter())));