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 record class ConfigFileContext( | |
DistributedApplicationModel AppModel, | |
Stream Stream, | |
CancellationToken CancellationToken | |
); | |
[DebuggerDisplay($"{{{nameof(Path)},nq}}")] | |
public class ConfigFileAnnotation(string path, Func<ConfigFileContext, Task> generator) : IResourceAnnotation | |
{ | |
public FileInfo Path { get; } = new FileInfo(path); |
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 DelayStartAnnotation(IResource waitForResource) : IResourceAnnotation | |
{ | |
public IResource WaitForResource { get; } = waitForResource; | |
} |
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 BackgroundRefreshableCache<TKey, TValue> | |
{ | |
public TimeSpan RefreshInterval { get; } | |
private readonly Func<TKey, Task<TValue>> _loader; | |
private ImmutableDictionary<TKey, Task<TValue>> _cache = ImmutableDictionary<TKey, Task<TValue>>.Empty; | |
public BackgroundRefreshableCache(Func<TKey, Task<TValue>> loader) | |
{ | |
_loader = loader; | |
} |
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.Threading.Tasks; | |
using Microsoft.Azure.Documents; | |
using Microsoft.Azure.Documents.Client; | |
namespace Cosmos | |
{ | |
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
// If you run the following with the cosmos emulator disabled, it takes about 2 minutes before the OpenAsync call fails | |
// Comment out the SetLocation line, and it takes about 8. | |
using System; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.Documents.Client; | |
namespace CosmosTimeoutTest | |
{ |
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 NUnit.Framework; | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace BackgroundRefreshable | |
{ | |
///<summary> | |
/// Provides support for loading, storing and refreshing a value asyncronously. | |
/// |
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
#Requires -Version 3.0 | |
<# | |
.Description | |
Installs Apache Solr | |
.Example | |
.\ServiceInstall.ps1 | |
Installs Apache Solr as the 'solr' service running on port 8983. | |
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
#This script calculates how many PRs each person merged | |
param( | |
[Parameter(Mandatory=$true)] | |
[string]$PersonalAccessToken, | |
[Parameter(Mandatory=$true)] | |
[string]$OrgOrUser, | |
[Parameter(Mandatory=$true)] | |
[string]$RepoName | |
) | |
$base64Token = [Convert]::ToBase64String([char[]]$PersonalAccessToken) |
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
<# | |
This is a begining of a script that will allow you to install a Telligent instance onto a clean vm. | |
Prequisites: | |
* Powershell 5 - https://www.microsoft.com/en-us/download/details.aspx?id=50395 | |
* SQL 2016 - http://go.microsoft.com/fwlink/?LinkID=799009 | |
SQL May be automatable, needs some more work. Powershell is not easily automatable as | |
installation of Powershell 5 will require a reboot, which will interupt script execution | |
#> |
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
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.2" Build="11.0.5343.0"> | |
<BatchSequence> | |
<Batch> | |
<Statements> | |
<StmtSimple StatementText="CREATE PROCEDURE nre_repo
AS
BEGIN
	CREATE TABLE #replies ( Id int NOT NULL PRIMARY KEY );

" StatementId="1" StatementCompId="52" StatementType="CREATE TABLE" RetrievedFromCache="true" /> | |
<StmtSimple StatementText="	Insert Into #replies
	exec sp_executesql N'select 1'

" StatementId="2" StatementCompId="53" StatementType="INSERT EXEC" RetrievedFromCache="true" StatementSubTreeCost="0.0132841" StatementEstRows="1" StatementOptmLevel="TRIVIAL" QueryHash="0xD6FBD67832A8F4DD" QueryPlanHash="0xD754250DFD9DD669"> | |
<StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false" /> | |
<QueryPlan CachedP |