Skip to content

Instantly share code, notes, and snippets.

View NikiforovAll's full-sized avatar
🇺🇦

Oleksii Nikiforov NikiforovAll

🇺🇦
View GitHub Profile
{
"id": "f0971e2a-c2a9-41bd-87b0-f29626cf4766",
"realm": "Test",
"notBefore": 0,
"defaultSignatureAlgorithm": "RS256",
"revokeRefreshToken": false,
"refreshTokenMaxReuse": 0,
"accessTokenLifespan": 300,
"accessTokenLifespanForImplicitFlow": 900,
"ssoSessionIdleTimeout": 1800,
@NikiforovAll
NikiforovAll / Program.cs
Created August 25, 2022 13:28
ConfigurationBuilder Example
using Microsoft.Extensions.Configuration;
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string>{ ["Label"] = "Secret"})
.AddEnvironmentVariables("MyAwesomeApp")
.AddUserSecrets<Program>()
.Build();
Console.WriteLine(configuration.GetDebugView().Trim(':').Trim());
@NikiforovAll
NikiforovAll / Program.cs
Created August 12, 2022 13:06
Search in XML <flowable:eventInParameter>
using Spectre.Console;
using System.Text.RegularExpressions;
foreach (var file in new DirectoryInfo(@"./bpmn-models").GetFiles("*.bpmn"))
{
ProcessFile(file);
}
void ProcessFile(FileInfo file)
{
@NikiforovAll
NikiforovAll / ProtectedView
Created June 11, 2022 06:51
ProtectedView
using System.Reflection;
namespace ProtectedViews;
public class ProtectedView
{
private readonly ISet<string> denyList;
public ProtectedView(params string[] fields)
{
@NikiforovAll
NikiforovAll / README.md
Last active April 4, 2022 12:45
Postgres + RabbitMQ + Seq

Developer Setup

This repository is intended for bootstrapping developer environment.

@NikiforovAll
NikiforovAll / README.md
Created June 10, 2021 12:32
GitLab Runner + Docker
@NikiforovAll
NikiforovAll / dates.ipynb
Last active June 9, 2021 19:25
DateTime vs DateTimeOffset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NikiforovAll
NikiforovAll / SDKClient.cs
Last active March 6, 2021 15:25
OpenAPI VS tool chain auto-generated http client example
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
@NikiforovAll
NikiforovAll / ContinueWith.cs
Last active December 18, 2020 23:52
playing with continuewith and custom synchronization context
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace cancellation_demo1
{
public static class ContinueWith
{
@NikiforovAll
NikiforovAll / PermutationsSource.cs
Last active October 19, 2020 20:23
csharp-loves-patterns
using System;
using System.Collections.Generic;
using System.Linq;
namespace LinqProviderExample
{
public class PermutationsSource
{
public PermutationsSource(params string[] words) => this.words = words;
private readonly HashSet<string> _generated = new();