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 NullableExtension | |
{ | |
public static bool TryGetValue<T>(this T? nullableValue, out T value) where T : struct | |
{ | |
if (!nullableValue.HasValue) | |
{ | |
value = default; | |
return false; | |
} |
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
{ | |
"version": "https://jsonfeed.org/version/1", | |
"title": "This is my feed title", | |
"home_page_url": "https://example.org/homepage", | |
"feed_url": "https://example.org/feed.json", | |
"description": "This is my feed description", | |
"user_comment": "This is a user comment", | |
"next_url": "https://example.org/feed.json?offset=1", | |
"icon": "https://example.org/icon.png", | |
"favicon": "https://example.org/favicon.ico", |
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.Runtime.CompilerServices; | |
public static class DebugHelper | |
{ | |
private static readonly ConditionalWeakTable<object, object> _objectIds = new ConditionalWeakTable<object, object>(); | |
private static int _lastObjectId; | |
private static readonly object _lock = new object(); | |
public static string GetObjectId(object obj) |
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
@charset "UTF-8"; | |
@font-face { | |
font-family: "feather"; | |
src: ~"url('@{icon-font-path}feather-webfont.eot')"; | |
src: ~"url('@{icon-font-path}feather-webfont.eot?#iefix') format('embedded-opentype')", | |
~"url('@{icon-font-path}feather-webfont.woff') format('woff')", | |
~"url('@{icon-font-path}feather-webfont.ttf') format('truetype')", | |
~"url('@{icon-font-path}feather-webfont.svg#featherregular') format('svg')"; | |
font-weight: normal; |
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.IO; | |
using System.Threading.Tasks; | |
using Seq.Api; | |
namespace SeqExportAllToJson | |
{ | |
internal 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
WITH [Numbers] AS | |
( | |
SELECT | |
[Ones].[Number] + | |
10 * [Tens].[Number] + | |
100 * [Hundreds].[Number] + | |
1000 * [Thousands].[Number] | |
AS [Number] | |
FROM (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) [Ones]([Number]), | |
(VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) [Tens]([Number]), |
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 System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Guids | |
{ | |
public static class SequentialGuid |
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
USE MASTER | |
ALTER DATABASE [DatabaseOldName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
ALTER DATABASE [DatabaseOldName] MODIFY NAME = [DatabaseNewName] | |
ALTER DATABASE [DatabaseNewName] SET MULTI_USER |
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
WITH [NodesWithParents] AS | |
( | |
SELECT * FROM [Nodes] n WHERE n.[Id] IN (...) | |
UNION ALL | |
SELECT parent.* FROM [Nodes] parent | |
INNER JOIN [NodesWithParents] child ON child.[ParentNode_Id] = parent.[Id] | |
) | |
SELECT DISTINCT [Id] FROM [NodesWithParents] |
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 | |
CONVERT(NVARCHAR(MAX), t.[table_schema]) AS [Owner], | |
CONVERT(NVARCHAR(MAX), t.[table_name]) AS [TableName], | |
MAX(i.[rows]) AS [RecordCount] | |
FROM | |
[sysindexes] i, | |
[information_schema].[tables] t | |
WHERE | |
t.[table_name] = OBJECT_NAME(i.[id]) | |
AND t.[table_type] = 'BASE TABLE' |