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
<div class="row text-muted"> | |
<strong>Bootstrap screen size:</strong> | |
<span class="visible-xs-inline">XS (Extra small)</span> | |
<span class="visible-sm-inline">SM (Small)</span> | |
<span class="visible-md-inline">MD (Medium)</span> | |
<span class="visible-lg-inline">LG (Large)</span> | |
</div> |
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
<configuration> | |
<configSections> | |
<sectionGroup name="common"> | |
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> | |
</sectionGroup> | |
</configSections> | |
<common> | |
<logging> |
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
# Objectify.ps1 | |
# Ben Brandt - July 18, 2014 | |
# Turns a tab-delimited table from the clipboard text, and converts it to a List of objects in C# code. | |
# Useful for taking data copied from SQL Management Studio (with Headers) and converting it to in-memory objects for use as test data. | |
function Get-ClipboardText() | |
{ | |
Add-Type -AssemblyName System.Windows.Forms | |
$tb = New-Object System.Windows.Forms.TextBox |
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
System.Data.Entity.Infrastructure.Interception.DbInterception.Add(new SqlMonitorInterceptor()); |
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; |
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.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
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 | |
{ |
OlderNewer