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; | |
namespace DynaCacheSimpleInjector | |
{ | |
using System.Threading; | |
using DynaCache; | |
using SimpleInjector; |
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
namespace DynaCacheSimpleInjector | |
{ | |
using DynaCache; | |
using SimpleInjector; | |
class Program | |
{ | |
static void Main() | |
{ |
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
namespace Microsoft.ServiceFabric.Data | |
{ | |
#region Using directives | |
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
#endregion |
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.Threading; | |
using System.Collections.Immutable; | |
using System.Linq; | |
using System.Threading.Tasks; | |
public class Program | |
{ | |
private static AsyncLocal<ImmutableStack<string>> stack = new AsyncLocal<ImmutableStack<string>>(); |
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
namespace MergeMP3 | |
{ | |
#region Using statements | |
using System; | |
using System.IO; | |
using NAudio.Wave; | |
#endregion |
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
function range(start: number, count: number) { | |
function* iterateRange() { | |
for (let i = start; i < count; i++) { | |
yield i; | |
} | |
} | |
return Array.from(iterateRange()); | |
} | |
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
void Main() | |
{ | |
Console.WriteLine(GetDefinition<Test>()); | |
/* Prints: | |
public class Test | |
{ | |
public System.Int32 Number { get; set; } | |
public System.String Name { get; set; } | |
} |
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> | |
/// A helper class that removes any characters that are unsupported in an Azure Table partition or row key value. | |
/// </summary> | |
/// <example> | |
/// this.PartitionKey = new SafeTableKey("Somestring with unsupported characters"); | |
/// this.RowKey = new SafeTableKey("...."); | |
/// </example> | |
public struct SafeTableKey : IEquatable<SafeTableKey> | |
{ | |
private static readonly ISet<char> reservedCharacters = new HashSet<char> { '\\', '/', '#', '?', '%' }; |
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
Import-Module IISAdministration | |
# Sets an environment variable for an IIS site in the applicationHost.config, rather than the web.config | |
# This allows for secrets to be stored securely, without any risk of them being added to source control. | |
function SetIISSiteEnvironmentVariable([string]$SiteName, [string]$Name, [string]$Value) { | |
$sm = Get-IISServerManager | |
$Env = $sm.GetApplicationHostConfiguration().GetSection("system.webServer/aspNetCore", $SiteName). | |
GetChildElement("environmentVariables"). | |
GetCollection() |
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 ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddExtendedDependencyTelemetry(this IServiceCollection services) | |
{ | |
services.AddSingleton<ITelemetryInitializer, ExtendedDependencyTelemetryInitializer>(); | |
return services; | |
} | |
} | |
public class ExtendedDependencyTelemetryInitializer : ITelemetryInitializer |
OlderNewer