This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace System { | |
public static partial class ExceptionExtensions { | |
/// <summary> | |
/// Returns a list of all the exception messages from the top-level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JSON Analysis</title> | |
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script> | |
<!-- I am not a javascript developer. I built a similar tool in C# and wanted to make it easier to share as a JS app. Most of this was built with the help of Chat GPT with some small adjustments by me. As a POC it works, but could probably be refactored to be better :-) --> | |
</head> | |
<body> | |
<h1>JSON Analysis</h1> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout main; git branch -D @(git branch | select-string -NotMatch "main" | Foreach {$_.Line.Trim()}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
public static class TestingHelpers | |
{ | |
/// <summary> | |
/// Opens a browser and displays the provided HTML, without needing to save it to disk | |
/// </summary> | |
public static void DisplayHtmlInBrowser(string html, string browserExe = "chrome.exe") | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Xunit.Abstractions; | |
namespace MyGists; | |
public class TestOutputLoggerFactory : ILoggerFactory | |
{ | |
private readonly ITestOutputHelper _testOutputHelper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc.ModelBinding; | |
namespace Demo.Web | |
{ | |
public class CustomDateTimeModelBinderProvider : IModelBinderProvider | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using System.Runtime.CompilerServices; | |
using System.Text.RegularExpressions; | |
namespace Demo.Attributes | |
{ | |
/// <summary> | |
/// DisplayName attribute that auto-generates a display name from the member name, splitting CamelCase name into words. | |
/// </summary> | |
[AutoDisplayName] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app', []).directive('ngDebounce', ['$timeout', function($timeout) { | |
return { | |
restrict: 'A', | |
require: 'ngModel', | |
priority: 99, | |
link: function(scope, elm, attr, ngModelCtrl) { | |
if (attr.type === 'radio' || attr.type === 'checkbox') return; | |
elm.unbind('input'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PieChart | |
{ | |
public PieChart() { | |
this.Slices = new List<PieChartSlice>(); | |
} | |
public List<PieChartSlice> Slices { get; set; } | |
public class PieChartSlice { | |
public decimal Value { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.Caching; | |
namespace SampleApp.Support | |
{ | |
public class TimeCachedValue<T> | |
{ | |
private readonly Func<T> valueFactory; | |
private readonly TimeSpan objectLifeSpan; |
NewerOlder