A simple animated bouncing duck on the Cosmic Unicorn display.
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
[ | |
{ | |
"title": "Whispers of the Ancients", | |
"genre": "Fantasy", | |
"author": "Elena Marrow", | |
"synopsis": "In a realm where magic intertwines with the fabric of reality, a forgotten prophecy surfaces, beckoning a young farmhand, Kael, into a labyrinth of mysteries and ancient powers. With the guidance of a mysterious sorceress, Kael embarks on a journey to unlock his latent magic and prevent the resurgence of a dark god." | |
}, | |
{ | |
"title": "The Last Starship", | |
"genre": "Science Fiction", |
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 on https://medium.com/@florian.baader/log-http-requests-with-refit-81ee47bffb05 | |
Usage: | |
services.AddRefitClient<TClient>(refitSettings) | |
.ConfigureHttpMessageHandlerBuilder(b => b.AdditionalHandlers.Add(new HttpLoggingHandler())); | |
*/ | |
public class HttpLoggingHandler : DelegatingHandler |
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 |
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
/// <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
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
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
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
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>>(); |
NewerOlder