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.Security.Cryptography; | |
public static class GeneratePasswordHelper | |
{ | |
private const byte _totalLength = 20; | |
public static string GeneratePassword(byte totalLength = _totalLength, RandomNumberGenerator? rng = null) | |
{ | |
#pragma warning disable CA2000 // call Dispose | |
rng ??= RandomNumberGenerator.Create(); |
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
set -ga update-environment EDITOR | |
# https://github.com/artemave/tmux_super_fingers | |
run-shell ~/.tmux/plugins/tmux_super_fingers/tmux_super_fingers.tmux | |
bind C-r source-file ~/.tmux.conf \; display "Reloaded!" | |
set -g mouse on | |
set-option -g history-limit 20000 | |
bind \` switch-client -t'{marked}' | |
set -g base-index 1 |
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
# C:\Users\Name\AppData\Roaming\alacritty\alacritty.toml | |
[window] | |
dynamic_padding = false | |
startup_mode = "Windowed" | |
opacity = 1 | |
[window.dimensions] | |
columns = 100 | |
lines = 85 |
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
local wezterm = require 'wezterm' | |
local act = wezterm.action | |
local config = wezterm.config_builder() | |
config.use_dead_keys = false | |
-- https://github.com/wez/wezterm/discussions/5102 | |
config.enable_kitty_keyboard = true | |
config.allow_win32_input_mode = false |
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 SpanExtensions | |
{ | |
public static Splitter<T> Splitter<T>( | |
this ReadOnlySpan<T> span, | |
ReadOnlySpan<T> delimiter) | |
where T : IEquatable<T> | |
{ | |
return new(span, delimiter); | |
} |
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
create or alter procedure [dbo].[Rename_Indices_ForeignKeyConstraints_ToEFCoreDefaults_CreateMissingDefaultIndices] | |
as | |
begin | |
set nocount on; | |
declare namesCursor cursor for | |
select | |
names2.schemaName, | |
names2.tableName, | |
names2.otherTableName, | |
names2.columnName, |
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.Collections; | |
using System.Diagnostics; | |
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
// Enumerates the bits from highest to lowest | |
public struct SetBitIndicesIterator<T> : IEnumerator<T> | |
where T : struct, Enum | |
{ | |
static SetBitIndicesIterator() => |
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
#nullable enable | |
using Microsoft.Extensions.DependencyInjection; | |
public static class ServiceRegistrationHelper | |
{ | |
/// <summary> | |
/// Registers the given implementation type under all implementations of a generic service, | |
/// implemented by the given implementation type. | |
/// </summary> | |
/// <returns>True if at least one implementation has been registered</returns> |
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 A | |
{ | |
public static void a<T>(this T[] l, in T t) where T : struct | |
{ | |
} | |
} | |
public static class B |
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 Zayats.Unity.View | |
{ | |
using UnityEngine; | |
using UnityEngine.UI; | |
public static class ScrollHelper | |
{ | |
public static void ScrollChildIntoView(this ScrollRect scrollRect, int childIndex) | |
{ | |
ScrollChildIntoView(scrollRect, (RectTransform) scrollRect.content.GetChild(childIndex)); |
NewerOlder