View BaseNotifyModel.cs
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; | |
namespace WPFSample | |
{ | |
public class BaseNotifyModel : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
protected void OnPropertyChanged([CallerMemberName] string name = null) |
View Sanitize.cs
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
// Copyright © Protiguous. All Rights Reserved. | |
// | |
// This entire copyright notice and license must be retained and must be kept visible in any binaries, libraries, repositories, or source code (directly or derived) from our binaries, libraries, projects, solutions, or applications. | |
// | |
// All source code belongs to Protiguous@Protiguous.com unless otherwise specified or the original license has been overwritten by formatting. (We try to avoid it from happening, but it does accidentally happen.) | |
// | |
// Any unmodified portions of source code gleaned from other sources still retain their original license and our thanks goes to those Authors. | |
// If you find your code unattributed in this source code, please let us know so we can properly attribute you and include the proper license and/or copyright(s). | |
// If you want to use any of our code in a commercial project, you must contact Protiguous@Protiguous.com for permission, license, and a quote. | |
// |
View Create Empty Reserve File.cmd
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
fsutil.exe file createnew "Emergency Disk Space (safe to delete).$$$" 8589934592 |
View ExpectedOutput.1-100.txt
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
1 | |
2 | |
Fizz | |
4 | |
Buzz | |
Fizz | |
7 | |
8 | |
Fizz | |
Buzz |
View FormatBytes.sql
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 [dbo].[FormatBytes]( 13241322.567567, 'bytes' ); | |
-- select [dbo].[FormatBytes]( 132413225.567567, 'bytes' ); | |
-- select [dbo].[FormatBytes]( 1324132255.567567, 'bytes' ); | |
-- select [dbo].[FormatBytes]( 13241322551.567567, 'bytes' ); | |
-- select [dbo].[FormatBytes]( 13241322.567567, 'mb' ); | |
-- select [dbo].[FormatBytes]( 132413225.567567, 'gb' ); | |
-- select [dbo].[FormatBytes]( 1324132255.567567, 'tb' ); | |
-- select [dbo].[FormatBytes]( 13241322551.567567, 'zb' ); | |
-- select [dbo].[FormatBytes]( 13241322551.567567, 'yb' ); | |
-- select [dbo].[FormatBytes]( 132413225512.567567, 'yb' ); |
View ListExample.cs
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
//Verified to run under .NET 5.0 Console Application. | |
namespace ConsoleApp1 { | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using JetBrains.Annotations; |
View ABetterClassDispose.cs
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
// Copyright © Protiguous. All Rights Reserved. | |
// | |
// This entire copyright notice and license must be retained and must be kept visible in any binaries, libraries, repositories, or source code (directly or derived) from our binaries, libraries, projects, solutions, or applications. | |
// | |
// All source code belongs to Protiguous@Protiguous.com unless otherwise specified or the original license has been overwritten by formatting. (We try to avoid it from happening, but it does accidentally happen.) | |
// | |
// Any unmodified portions of source code gleaned from other sources still retain their original license and our thanks goes to those Authors. | |
// If you find your code unattributed in this source code, please let us know so we can properly attribute you and include the proper license and/or copyright(s). | |
// If you want to use any of our code in a commercial project, you must contact Protiguous@Protiguous.com for permission, license, and a quote. | |
// |
View Drop and Create Service Broker objects.sql
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
-- Based from https://sqlperformance.com/2014/03/sql-performance/configuring-service-broker | |
USE [master] | |
GO | |
ALTER DATABASE [Test] SET ENABLE_BROKER WITH NO_WAIT | |
GO | |
USE [Test] | |
GO |
View Draw BrentOzar.sql
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
/*Adrian Sullivan - 2019/11/15 Fun with polygons.*/ | |
/*Thanks to Michael J Swart for all the awesome work on color | |
https://michaeljswart.com/ | |
*/ | |
DECLARE @tt table(id int identity(0,1), label VARCHAR(50), gg GEOMETRY) | |
SET NOCOUNT ON | |
DECLARE @g geometry = 'POLYGON((-121.97087 37.372518,-121.97087 37.372518,-121.970863 37.372517,-121.970845 37.372515,-121.97087 37.372518))' |
View FullDBBackup.ps1
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
$serverName = ".\SQLExpress" | |
$backupDirectory = "D:\backupSQL" | |
$daysToStoreDailyBackups = 7 | |
$daysToStoreWeeklyBackups = 28 | |
$monthsToStoreMonthlyBackups = 3 | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null |
NewerOlder