Enable Long Paths in Windows 10, Version 1607, and Later
git config --system core.longpaths true
using System.Collections; | |
using System.Collections.Immutable; | |
using System.ComponentModel; | |
using System.Reactive.Subjects; | |
using CSharpFunctionalExtensions; | |
namespace Example; | |
public sealed class ChangeErrorsSubject : ISubject<ImmutableList<PropertyDataError>>, INotifyDataErrorInfo, IDisposable | |
{ |
# Ref: https://stackoverflow.com/a/67392622/23266117 | |
locals { | |
input = file("./sample.txt") | |
map = { | |
food = "Sushi" | |
name = "Data_sniffer" | |
} | |
out = join("\n", [ |
public static class FormatExtensions | |
{ | |
public static string Int32ToString(int a) | |
{ | |
const int radix = 10; | |
const int maxLength = 11; | |
Span<char> str = stackalloc char[maxLength]; | |
int i = str.Length; | |
bool isNegative = a < 0; |
# Global | |
[includeIf "gitdir/i:C:/Users/<user>/Source/repos/github/<user>/"] | |
path = C:/Users/<user>/Source/repos/github/<user>/.gitconfig | |
[includeIf "gitdir/i:~/Source/repos/github/<user>/"] | |
path = ~/Source/repos/github/<user>/.gitconfig | |
# Path | |
[user] | |
email = <email> |
Claim displayName = ClaimsPrincipal.Current.FindFirst(ClaimsPrincipal.Current.Identities.First().NameClaimType); | |
ViewBag.DisplayName = displayName != null ? displayName.Value : string.Empty; |
/** | |
* Returns the index of the last element in the array where predicate is true, and -1 | |
* otherwise. | |
* @param array The source array to search in | |
* @param predicate find calls predicate once for each element of the array, in descending | |
* order, until it finds one where predicate returns true. If such an element is found, | |
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. | |
*/ | |
export function findLastIndex<T>(array: Array<T>, predicate: (value: T, index: number, obj: T[]) => boolean): number { | |
let l = array.length; |
Enable Long Paths in Windows 10, Version 1607, and Later
git config --system core.longpaths true
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
public static class ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddSelfWithInterfacesSingleton<TService>(this IServiceCollection services) | |
where TService : class | |
{ | |
services.AddSingleton<TService>(); |
# Format: - 2023-05-15 Name: Commit message | |
git log --cherry-pick --right-only --no-merges --reverse --pretty="- %ad %cn: %s" --date=short branch-a...branch-b | |
# Format: - 2023-05-15 Commit message | |
git log --cherry-pick --reverse --pretty="- %ad %<(35,trunc)%s" --date=short branch-a...branch-b | |
# Format: [email protected] 2023-04-25 initial commit | |
git log --cherry --reverse --pretty="%<(20,trunc)%ce%x09%>(10)%ad%x09%s" --date=short branch-a...branch-b | |
git log --cherry --reverse branch-a...branch-b |
# 1. Get a free S/MIME e-mail certificate | |
# Actalis: https://extrassl.actalis.it/portal/uapub/freemail?lang=en | |
# 2. GNU privacy guard - S/MIME version | |
sudo apt install gpgsm | |
# 3. Import PKCS12 certificate | |
gpgsm --import certificate_s_mime.p12 | |
# 4. Set your signing key |