Skip to content

Instantly share code, notes, and snippets.

View dphoebus's full-sized avatar
😏

Daniel Phoebus dphoebus

😏
  • CaptiveAire, Inc.
View GitHub Profile
@davidfowl
davidfowl / .NET6Migration.md
Last active April 11, 2024 02:02
.NET 6 ASP.NET Core Migration
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@emyann
emyann / web.config
Last active August 21, 2017 17:21
ASP.NET web.config configuration for Single Page Application (AngularJS) running on IIS with OwinHttpHandler
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<rewrite>
<rules>
@jawadatgithub
jawadatgithub / OIDC and OAuth2 Flows.md
Last active February 11, 2024 23:15
Enrich IdentityServer3 Documentation with OIDC (OpenID Connect) and OAuth2 Flows section
Note for community:

A. IdentityServer3 docs, samples and source code use OIDC & OAuth2 terms interchangeably to refer to same thing in many areas. I think that's make sense because OIDC introduced as complement & extension for OAuth2.

B. IdentityServer3, STS, OP, OIDC server, OAuth2 server, CSP, IDP and others: means same thing (software that provide/issue tokens to clients) as explained in [Terminology] (http://identityserver.github.io/Documentation/docs/overview/terminology.html).

C. Grants and flows mean same thing, grant was the common term in OAuth2 specs and flow is the common term in OIDC specs.

D. This document will not focus on custom flow/grant.

E. [Important] Choosing wrong flow leads to security threat.

/*
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
Microsoft Open Technologies would like to thank its contributors, a list
of whom are at http://aspnetwebstack.codeplex.com/wikipage?title=Contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@lkaczanowski
lkaczanowski / CustomHandleErrorAttribute.cs
Last active November 14, 2020 00:33
Custom ASP.NET MVC handle error attribute. Handles and logs all errors.
public class CustomHandleErrorAttribute : HandleErrorAttribute
{
private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public override void OnException(ExceptionContext filterContext)
{
if (!filterContext.HttpContext.IsCustomErrorEnabled)
{
return;
}
@troyanov
troyanov / CoreAutomation.tt
Last active March 7, 2020 09:22
Generate Enums from database lookup tables. CoreAutomation.tt - t4 helper class, that uses EnvDTE to get all Projects in Solution, configurations, etc. DBEnum.tt - generates enums for tables by criteria enumDescriptionColumnName
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output encoding="utf-8" extension=".cs"#>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="EnvDTE80" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Configuration" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Configuration" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="EnvDTE" #>
@peteroupc
peteroupc / QueryStringHelper.cs
Last active October 18, 2023 09:20
A C# utility class for parsing query strings.
// Written by Peter O.
// Any copyright to this work is released to the Public Domain.
// https://creativecommons.org/publicdomain/zero/1.0/
//
//
//
using System;
using System.Collections.Generic;
using System.Globalization;
@joliver
joliver / gist:1311195
Created October 25, 2011 03:16
NServiceBusCommitDispatcher
public sealed class NServiceBusCommitDispatcher : IPublishMessages
{
private const string AggregateIdKey = "AggregateId";
private const string CommitVersionKey = "CommitVersion";
private const string EventVersionKey = "EventVersion";
private const string BusPrefixKey = "Bus.";
private readonly IBus bus;
public NServiceBusCommitDispatcher(IBus bus)
{