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 EnvDTE; | |
using EnvDTE80; | |
public class C : VisualCommanderExt.ICommand | |
{ | |
public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) | |
{ | |
try | |
{ | |
DTE.ExecuteCommand("ReSharper_Suspend"); |
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
Update-ExecutionPolicy -Policy Unrestricted | |
Get-AppxPackage -Name Microsoft.ZuneVideo | Remove-AppxPackage | |
Get-AppxPackage -Name Microsoft.ZuneMusic | Remove-AppxPackage | |
Get-AppxPackage -Name Microsoft.BingFinance | Remove-AppxPackage | |
Get-AppxPackage -Name Microsoft.BingWeather | Remove-AppxPackage | |
Get-AppxPackage -Name Microsoft.BingNews | Remove-AppxPackage | |
Get-AppxPackage -Name Microsoft.Getstarted | Remove-AppxPackage | |
Get-AppxPackage -Name Microsoft.Windows.Photos | Remove-AppxPackage | |
Get-AppxPackage -Name Microsoft.XboxApp | Remove-AppxPackage |
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
[alias] | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit | |
branch-name = !git rev-parse --abbrev-ref HEAD | |
whats-new = !git log develop.. --oneline | |
delete-merged = "!f() { git checkout --quiet develop && git branch --merged | grep --invert-match '\\\\*' | xargs -n 1 git branch --delete; git |
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 QueryExtensions | |
{ | |
public static long FastCount<TEntity>(this DbContext context) where TEntity : class | |
{ | |
var name = context.GetTableName<TEntity>(); | |
var sql = | |
$@"SELECT SUM (row_count) | |
FROM sys.dm_db_partition_stats | |
WHERE object_id=OBJECT_ID('{name}') | |
AND (index_id=0 or index_id=1);"; |
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.Linq; | |
using System.Threading.Tasks; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Diagnostics.Windows; | |
using BenchmarkDotNet.Running; | |
namespace ParallelForEachUpdateBenchmark | |
{ |
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
// apply assembly wide via [assembly: TestCaseOrderer("FullyNamespacedTypeName", "AssemblyName")] | |
public class ReverseOrderTestCaseOrderer : ITestCaseOrderer | |
{ | |
public IEnumerable<TTestCase> OrderTestCases<TTestCase>(IEnumerable<TTestCase> testCases) where TTestCase : ITestCase | |
{ | |
var results = testCases.ToList(); | |
results.Reverse(); | |
return results; | |
} | |
} |
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 CallerCommandInterceptor : IDbCommandInterceptor | |
{ | |
public void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext<int> interceptionContext) => AddCaller(command); | |
public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext) => AddCaller(command); | |
public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext<object> interceptionContext) => AddCaller(command); | |
public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext<object> interceptionContext) { } | |
public void ReaderExecuted(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext) { } | |
public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext<int> interceptionContext) { } |
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.Text; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Diagnostics.Windows; | |
using BenchmarkDotNet.Running; | |
namespace StringBuilderBenchmarks | |
{ | |
class Program |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp1.1</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /> | |
<PackageReference Include="Shouldly" Version="2.8.2" /> | |
<PackageReference Include="xunit" Version="2.2.0" /> |
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.Threading.Tasks; | |
using Xunit; | |
namespace XUnitTestProject1 | |
{ | |
public class Works | |
{ | |
[Fact] | |
public void Test1() |
OlderNewer