BenchmarkDotNet=v0.10.3.0, OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i7-4850HQ CPU 2.30GHz, ProcessorCount=3
Frequency=10000000 Hz, Resolution=100.0000 ns, Timer=UNKNOWN
[Host] : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1590.0
Clr : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1590.0
Core : .NET Core 4.6.25009.03, 64bit RyuJIT
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
# editorconfig.org | |
root = true | |
# Don't use tabs for indentation. | |
[*] | |
indent_style = space | |
[*.less] | |
charset = utf-8 | |
end_of_line = lf |
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
@-moz-document domain("stackoverflow.com"), domain("stackexchange.com"), domain("serverfault.com"), domain("askubuntu.com"), domain("stackapps.com"), domain("superuser.com") { | |
.profiler-result tr[style*='display: block;'] { | |
display: table-row !important; | |
} | |
.profiler-result th[style*='display: block;'], .profiler-result td[style*='display: block;'] { | |
display: table-cell!important; | |
} | |
} | |
@-moz-document domain("chat.meta.stackexchange.com"), domain("chat.stackexchange.com"), domain("chat.stackoverflow.com") { |
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 [tag.iface], [tag.host], Sum([value]) [value], [timestamp] | |
FROM (SELECT [tag.iface], [tag.host], [tag.direction], [dateDiff], Max([value]) [value], | |
DateAdd(Second, DateDiff(Second, GETUTCDATE(), [timestamp]) / 15 * 15, GETUTCDATE()) [timestamp] | |
FROM (SELECT [tag.iface], | |
[tag.host], | |
[tag.direction], | |
[timestamp], | |
DateDiff(Second, [LastTime], [timestamp]) [dateDiff], | |
--(([value] - [LastValue]) / NullIf(DateDiff(Second, [LastTime], [timestamp]), 0)) [value] | |
(([value] - [LastValue]) / DateDiff(Second, [LastTime], [timestamp])) [value] |
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
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"><asmv3:application><asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"><dpiAware>True</dpiAware></asmv3:windowsSettings></asmv3:application><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /></dependentAssembly></dependency><dependency><dependentAssembly><assemblyIdentity type="win32" name="debuggerproxy.dll" processorArchitecture="X86" version="1.0.0.0"></assemblyIdentity></dependentAssembly></dependency></assembly>'; | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide" -Name PreferExternalManifest -Value 1 -Type DWord; | |
$ssms16 = "C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe"; | |
if (( |
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
# Must be run as admin for registry changes | |
# This illustrates the problem with the Stack Exchange VPN, results locally: | |
# Total time for default behavior (seconds): 12.0566448 | |
# Total time with registry tweaks (seconds): 1.0808937 | |
# Broken/Slow (default Windows 10 behavior) | |
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows NT\DNSClient" -Name DisableSmartNameResolution -Value 0 -Type DWord | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name DisableParallelAandAAAA -Value 0 -Type DWord | |
ipconfig /flushdns | Out-null | |
Write-Host "Total time for default behavior (seconds): " -NoNewLine |
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
-- For production | |
--CREATE DATABASE [TrafficLogs] CONTAINMENT = NONE ON | |
--PRIMARY ( NAME = N'TrafficLogs', FILENAME = N'E:\Data\TrafficLogs.mdf' , SIZE = 102400000KB , FILEGROWTH = 5120000KB), | |
--FILEGROUP [TrafficLogs_D] ( NAME = N'TrafficLogs_D', FILENAME = N'D:\Data\TrafficLogs_D.ndf' , SIZE = 102400000KB, FILEGROWTH = 51200000KB), | |
--FILEGROUP [TrafficLogs_E] ( NAME = N'TrafficLogs_E', FILENAME = N'E:\Data\TrafficLogs_E.ndf' , SIZE = 1024000000KB, FILEGROWTH = 51200000KB) | |
--LOG ON ( NAME = N'TrafficLogs_log', FILENAME = N'D:\Data\TrafficLogs.ldf' , SIZE = 51200000KB , FILEGROWTH = 10240000KB) | |
--GO | |
-- For local development | |
Declare @dataPath nvarchar(500) = Cast(ServerProperty('instancedefaultdatapath') as nvarchar(500)), |
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
// ***** BenchmarkRunner: Start ***** | |
// Found benchmarks: | |
// JSONBenchmarks.'.ToJson(): Minimal MiniProfiler': DefaultJob | |
// JSONBenchmarks.'MiniProfiler.FromJson: Minimal MiniProfiler': DefaultJob | |
// Validating benchmarks: | |
// ************************** | |
// Benchmark: JSONBenchmarks.'.ToJson(): Minimal MiniProfiler': DefaultJob | |
// *** Generate *** | |
// Result = Success |
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.IO; | |
using System.Web; | |
using System.Web.Hosting; | |
namespace StackOverflow.Helpers | |
{ | |
public static class Svg | |
{ | |
// NOTE: To add a new SVG icon, copy paste the line below. Paste it after the other ones. |
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 List<T> Query<T>(this DataContext db, string sql, object param = null, int? commandTimeout = null, IDbTransaction transaction = null, [CallerFilePath]string fromFile = null, [CallerLineNumber]int onLine = 0, string comment = null) | |
{ | |
using (db.Connection.EnsureOpen()) | |
{ | |
try | |
{ | |
return db.Connection.Query<T>(MarkSqlString(sql, fromFile, onLine, comment), param, transaction ?? db.Transaction, true, commandTimeout).AsDapperList(); | |
} | |
catch (SqlException ex) when (ex.Is(SqlErrorCode.DatabaseReadOnly_3906)) | |
{ |