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
SELECT | |
[state_desc] [State], | |
[recovery_model_desc] [Recovery Model], | |
[log_reuse_wait_desc] [Log Reuse Wait Reason], | |
[name] [Database], | |
[is_auto_shrink_on] [Auto Shrink Enabled] | |
FROM [master].[sys].[databases] | |
ORDER BY [State], [Recovery Model], [Log Reuse Wait Reason], [Database] |
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
SELECT name | |
FROM master.sys.syslogins [Login] | |
WHERE [Login].[sysadmin] = 1 | |
AND [name] <> 'sa' | |
AND [name] NOT LIKE 'NT Service%' |
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
-- Set this value to a reasonable value to filter out extraneous timings | |
DECLARE @MinTimingThresholdMilliseconds = 10; | |
SELECT | |
[EventSource], | |
[Component], | |
COUNT([Timing]) [EventCount], | |
MIN([Timing]) [Min Time (ms)], | |
AVG([Timing]) [Average Time (ms)], | |
MAX([Timing]) [Max Time (ms)], |
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; | |
using Moq.Language.Flow; | |
namespace Moq.Sequencing | |
{ | |
public static class CallSequenceExtensions | |
{ | |
public static void InSequence<TMock>(this ISetup<TMock> setup, CallSequence callSequence) where TMock : class |
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 CommandLineArgumentParserHandler : IHandler<string, IArgumentParser> | |
{ | |
private readonly CommandLineArgumentParser _service; | |
public CommandLineArgumentParserHandler(CommandLineArgumentParser service) | |
{ | |
_service = service; | |
} |
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
# Written by Mike Bantegui (Last Updated 2015-03-05) | |
# Use at your own caution! I take no responsibility for any damage you may cause on your system. | |
# Known to support: Windows Server 2012 R2 | |
function Request-ElevatedPrompt | |
{ | |
# Adapted from Benjamin Armstrong's "A self elevating PowerShell script" | |
# http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/09/23/a-self-elevating-powershell-script.aspx | |
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$principal = New-Object System.Security.Principal.WindowsPrincipal($identity) |
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
# Note: The below does not yet handle paths with spaces because I was being lazy. | |
function Import-SvnRepository($SvnAdminPath, $RepositoryPath, $InputPath) | |
{ | |
& cmd /c "`"$SvnAdminPath`" load $RepositoryPath --memory-cache-size 256 < $InputPath" | |
} | |
function Export-SvnRepository($SvnAdminPath, $RepositoryPath, $OutputPath, [Switch]$UseDelta) | |
{ | |
if ($UseDelta) |
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 FileDialogFilter | |
{ | |
private readonly string _filter; | |
private readonly string _description; | |
public string Description | |
{ | |
get { return _description; } | |
} |
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 static class NotifyPropertyChangedExtensions | |
{ | |
private static PropertyInfo GetPropertyInfo<TSource, TProperty>(Expression<Func<TSource, TProperty>> propertyExpression) | |
{ | |
var type = typeof(TSource); | |
var memberExpression = propertyExpression.Body as MemberExpression; | |
if (memberExpression == null) | |
{ | |
var message = string.Format("Expression '{0}' refers to a method, not a property.", propertyExpression); |
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 static class FormatConfig | |
{ | |
private class JsonContentNegotiator : IContentNegotiator | |
{ | |
private readonly JsonMediaTypeFormatter _jsonFormatter; | |
public JsonContentNegotiator(JsonMediaTypeFormatter formatter) | |
{ | |
_jsonFormatter = formatter; | |
} |
OlderNewer