View empty-git-commit.sh
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
# macos single chars are fine | |
git commit --allow-empty -m 'ci: empty commit for pr [skip ci]' | |
# windows needs double chars | |
git commit --allow-empty -m "ci: empty commit for pr [skip ci]" |
View HttpContextExtensions.cs
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 Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; | |
using System; | |
using System.IO; | |
/// <summary> | |
/// Provides extension methods for the HttpContext class. | |
/// </summary> | |
public static class HttpContextExtensions |
View DotnetAndProductVersion.cs
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.Reflection; | |
var dotnetVersion = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; | |
Console.WriteLine($"🌄 .NET Version: {dotnetVersion}"); | |
var productVersion = Assembly.GetEntryAssembly().GetCustomAttribute<System.Reflection.AssemblyInformationalVersionAttribute>().InformationalVersion; | |
Console.WriteLine($"🌄 Product Version : {productVersion}"); |
View DotnetVersion.cs
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; | |
var dotnetVersion = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; | |
Console.WriteLine($"🌄 .NET Version: {dotnetVersion}"); |
View DateOnly.HowOldIsPerson.cs
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; | |
Console.WriteLine("No static void main"); | |
var p = new Person(Guid.NewGuid(), "John", new DateOnly(1975, 1, 1)); | |
Console.WriteLine(p.ToString()); | |
public record Person(Guid Id, string Name, DateOnly DateOfBirth) | |
{ | |
public override string ToString() |
View slugify.js
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 slugify(input) { | |
if (!input) | |
return ''; | |
// make lower case and trim | |
var slug = input.toLowerCase().trim(); | |
// remove accents from charaters | |
slug = slug.normalize('NFD').replace(/[\u0300-\u036f]/g, '') |
View omnisharp.json
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
{ | |
"RoslynExtensionsOptions": { | |
"EnableAnalyzersSupport": true, | |
"EnableDecompilationSupport": true, | |
"EnableImportCompletion": true | |
}, | |
"FormattingOptions": { | |
"EnableEditorConfigSupport": true, | |
"OrganizeImports": true | |
}, |
View download-all-images.js
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
$$('img').forEach(async (img) => { | |
try { | |
const src = img.src; | |
// Fetch the image as a blob. | |
const fetchResponse = await fetch(src); | |
const blob = await fetchResponse.blob(); | |
const mimeType = blob.type; | |
// Figure out a name for it from the src and the mime-type. | |
const start = src.lastIndexOf('/') + 1; | |
const end = src.indexOf('.', start); |
View Money.cs
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 Money | |
{ | |
private static readonly IReadOnlyCollection<string> SupportedCurrencies = new[] { "GBP", "EUR" }; | |
public decimal Amount { get; } | |
public string Currency { get; } | |
private Money(decimal amount, string currency) | |
{ | |
Amount = amount; |
View settings.json
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
{ | |
"colorscheme": "bubblegum", | |
"fontFace": "IntelOne Mono" | |
} |
NewerOlder