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
/// <summary> | |
/// Sample struct that shows how to override GetHashCode and Equals, as well as the == and != | |
/// operators. | |
/// </summary> | |
/// <remarks> | |
/// This type is immutable. | |
/// </remarks> | |
public struct SampleStruct | |
{ | |
#region Private Backing Fields |
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
# ------------------------------------------------------------------------------------------------- | |
# Pinger.ps1 | |
# | |
# Repeatedly pings the specified server until the ping is successful. | |
# ------------------------------------------------------------------------------------------------- | |
# Script params | |
param([String]$server) | |
# Script param validation |
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 SystemTime | |
{ | |
public static Func<DateTime> Now = () => DateTime.Now; | |
public static Func<DateTime> UtcNow = () => DateTime.UtcNow; | |
} |
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
-- | |
-- 2021-11-24: suggestion from comments: | |
-- | |
DECLARE @EmptyEmpty UNIQUEIDENTIFIER = CAST(0x0 AS UNIQUEIDENTIFIER) | |
SELECT @EmptyEmpty | |
-- | |
-- Original | |
-- |
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
# Visual Studio | |
*.[Oo]bj | |
[Bb]in/ | |
[Oo]bj/ | |
*.suo | |
*.user | |
*.[Pp]ublish.xml | |
*.dbmdl | |
Import Schema Logs/ | |
src/{DATABASE_PROJECT_NAME}/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
using System; | |
using Lucene.Net.Analysis; | |
using Lucene.Net.Analysis.Standard; | |
using Lucene.Net.Documents; | |
using Lucene.Net.Index; | |
using Lucene.Net.QueryParsers; | |
using Lucene.Net.Search; | |
using Lucene.Net.Store; |
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
# ------------------------------------------------------------------------------------------------- | |
# Does a hot copy backup of all Subversion repositories. | |
# ------------------------------------------------------------------------------------------------- | |
$hotCopySource = "C:\Subversion\Repositories" | |
$hotCopyDest = "C:\SubversionBackups" | |
$svnadmin_exe = "C:\Program Files (x86)\VisualSVN Server\bin\svnadmin.exe" | |
$7za_exe = "C:\Subversion\7za.exe" | |
if ([IO.Directory]::Exists($hotCopyDest)) { |
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
/// <summary> | |
/// Checks to see if source is in the items collection. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="source"></param> | |
/// <param name="items"></param> | |
/// <returns></returns> | |
public static bool In<T>(this T source, params T[] items) | |
{ | |
if (items == null) |
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 LinqExtensions | |
{ | |
public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, bool isAscending) | |
{ | |
return isAscending | |
? source.OrderBy(keySelector) | |
: source.OrderByDescending(keySelector); | |
} | |
public static IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, bool isAscending) |
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
var hexNum = "0x000000000000E295"; | |
long result; | |
long.TryParse( | |
hexNum.Substring(2), | |
System.Globalization.NumberStyles.HexNumber | System.Globalization.NumberStyles.AllowHexSpecifier, | |
System.Globalization.CultureInfo.CurrentCulture, | |
out result | |
); | |
//result.Dump(); | |
var resultBytes = BitConverter.GetBytes(result); |
OlderNewer