Skip to content

Instantly share code, notes, and snippets.

View babieiev's full-sized avatar
🧙‍♂️

Oleksandr Babieiev babieiev

🧙‍♂️
View GitHub Profile
@davidfowl
davidfowl / dotnetlayout.md
Last active May 6, 2025 09:59
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@dprice
dprice / Microsoft.PowerShell_profile.ps1
Last active March 18, 2025 14:53
PowerShell Profile #tag PowerShell
$sw = [Diagnostics.Stopwatch]::StartNew()
Write-Host "Updating path..." -foregroundColor DarkGreen
if(!($env:path).contains((Split-Path $PROFILE))) {
$env:path += ";" + (Split-Path $PROFILE)
}
if(!($env:path).contains('D:\dNx\dnx-util;')) {
$env:path += ";" + 'D:\dNx\dnx-util;'
}
if(!($env:path).contains('D:\dNx\dnx-util\test;')) {
$env:path += ";" + 'D:\dNx\dnx-util\test;'
@jdhitsolutions
jdhitsolutions / Optimize-PSReadLineHistory.ps1
Last active December 3, 2024 11:30
A PowerShell command to trim the command history file used by PSReadline
#requires -version 5.0
#requires -module PSReadline
Function Optimize-PSReadLineHistory {
<#
.SYNOPSIS
Optimize the PSReadline history file
.DESCRIPTION
The PSReadline module can maintain a persistent command-line history. However, there are no provisions for managing the file. When the file gets very large, performance starting PowerShell can be affected. This command will trim the history file to a specified length as well as removing any duplicate entries.
.PARAMETER MaximumLineCount
@alejandro-martin
alejandro-martin / multiple-ssh-keys-git.adoc
Last active May 4, 2025 01:22
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@SteveL-MSFT
SteveL-MSFT / profile.ps1
Last active April 13, 2025 16:07
PowerShell Prompt
#Requires -Version 7
# Version 1.2.13
# check if newer version
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e"
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version')
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)"
if ([System.IO.File]::Exists($latestVersionFile)) {
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@kapsiR
kapsiR / PowerShell_profile.ps1
Last active April 24, 2024 13:12
PowerShell Profile
function SetupProfile()
{
Import-Module posh-git
$GitPromptSettings.BranchColor.ForegroundColor = 'Black'
$GitPromptSettings.BeforeStatus.ForegroundColor = 'Black'
$GitPromptSettings.AfterStatus.ForegroundColor = 'Black'
$GitPromptSettings.DelimStatus.ForegroundColor = 'Black'
$GitPromptSettings.BranchBehindAndAheadStatusSymbol.ForegroundColor = 'DarkRed'
oh-my-posh.exe init pwsh --config "~/.oh-my-posh.omp.json" | Invoke-Expression
@phil-scott-78
phil-scott-78 / Microsoft.PowerShell_profile.ps1
Last active November 19, 2022 18:19
Powershell Profile
function Run-Step([string] $Description, [ScriptBlock]$script)
{
Write-Host -NoNewline "Loading " $Description.PadRight(20)
& $script
Write-Host "`u{2705}" # checkmark emoji
}
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
$stopwatch = [system.diagnostics.stopwatch]::StartNew()