Skip to content

Instantly share code, notes, and snippets.

@mykeels
mykeels / RsaKeyService.cs
Last active January 26, 2024 03:47
For IdentityServer4's AddSigningCredentials in production
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.IdentityModel.Tokens;
@Stanback
Stanback / nginx.conf
Last active May 3, 2024 12:01 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@fdeitelhoff
fdeitelhoff / CombineWithRepetition.cs
Created February 27, 2013 22:53
C# implementation for a combination with repetition. Implemented as an extension method for IEnumerable<char>.
public static IEnumerable<IList<char>> CombineWithRepetitions(this IEnumerable<char> input, int take)
{
ICollection<IList<char>> output = new Collection<IList<char>>();
IList<char> item = new char[take];
CombineWithRepetitions(output, input, item, 0);
return output;
}