Skip to content

Instantly share code, notes, and snippets.

View MiddleTommy's full-sized avatar

Thomas Tucker MiddleTommy

  • Tuckered Software
  • California
View GitHub Profile
@MiddleTommy
MiddleTommy / gist:5a571dd3787837c6a83a30806907979f
Last active December 3, 2021 08:53
Get Count Occurrences of substring in string
/// <summary>
/// Gets the count of substrings in the string
/// </summary>
/// <param name="text"></param>
/// <param name="substring"></param>
/// <returns></returns>
public static int GetCount(this string text, string substring)
{
int count = 0;
var span = text.AsSpan();
@MiddleTommy
MiddleTommy / Auth0Sample.cs
Created November 13, 2016 01:13
C# Auth0.Core login/register Samples
using System;
using System.Threading.Tasks;
using Auth0.AuthenticationApi;
using Auth0.AuthenticationApi.Models;
namespace Cards.Documents.Authorization
{
public class Auth0Example
{
string auth0domain;