View remove-all-boms.ps1
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
param( | |
[string] $Folder = ".", | |
[string] $Filter = "*.*" | |
) | |
Get-ChildItem -Path $Folder -Recurse -File -Filter $Filter -Exclude @('obj','bin') | Foreach-Object { | |
$contents = [System.IO.File]::ReadAllBytes($_.FullName) | |
if ($contents.Length -gt 2 -and $contents[0] -eq 0xEF -and $contents[1] -eq 0xBB -and $contents[2] -eq 0xBF) { | |
Write-Host $_.FullName | |
[System.IO.File]::WriteAllBytes($_.FullName, $bytes[3..$($bytes.Length)]) |
View 1 - In Code.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 class SampleTests | |
{ | |
public bool SomeCondition => ...; | |
[Fact] | |
public void MySkipWhen() | |
{ | |
Assert.SkipWhen(SomeCondition, "This is dynamically skipped when SomeCondition is true"); | |
} |
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
{ | |
"$help": "https://aka.ms/terminal-documentation", | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": [ | |
{ | |
"command": "copy", | |
"keys": "ctrl+shift+c" | |
}, | |
{ | |
"command": "paste", |
View profile.ps1
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
######## POSH-GIT | |
# ... Import-Module for posh-git here ... | |
# Background colors | |
$GitPromptSettings.AfterStash.BackgroundColor = 0x5F5FAF | |
$GitPromptSettings.AfterStatus.BackgroundColor = 0x5F5FAF | |
$GitPromptSettings.BeforeIndex.BackgroundColor = 0x5F5FAF | |
$GitPromptSettings.BeforeStash.BackgroundColor = 0x5F5FAF |
View gist:be689377ea2a9f8d94bf2ca3a8424cbd
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
Install applications: | |
- Beyond Compare | |
- Chromium | |
- dconf Editor | |
- GIMP | |
- Gnome Tweaks | |
- Htop | |
- Insync | |
- JetBrains Rider | |
- Remmina |
View ConvertTo-MP3.ps1
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
param( | |
[string][Parameter(Mandatory=$true)]$InputFile, | |
[string][Parameter(Mandatory=$true)]$OutputFile, | |
[int]$SampleRate = 44100, | |
[string]$BitRate = "160k" | |
) | |
$ErrorActionPreference = "Stop" | |
$InputFile = [System.IO.Path]::Combine((Get-Location), $InputFile) |
View normalize-names.ps1
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
param( | |
[string][Parameter(Mandatory = $true)] $Location, | |
[switch] $SkipFolderRename | |
) | |
Set-StrictMode -Version Latest | |
$ErrorActionPreference = "Stop" | |
$oldEncoding = [Console]::OutputEncoding | |
$caseInsensitive = [StringComparison]"OrdinalIgnoreCase" |
View docker-clean.ps1
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
(& docker images --all --quiet --filter 'dangling=true') | Foreach-Object { | |
& docker rmi $_ | out-null | |
} | |
(& docker ps --quiet --filter 'status=exited' ) | Foreach-Object { | |
& docker rm $_ | out-null | |
} |
View .gitconfig
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
[user] | |
name = Brad Wilson | |
email = dotnetguy@gmail.com | |
signingkey = 0B7BD15AD1EC5FDE | |
[alias] | |
a = add -A | |
abort = rebase --abort | |
amend = commit --amend -C HEAD | |
bclean = "!f() { git switch ${1-main} && git branch --merged ${1-main} | grep -v ${1-main}$ | xargs git branch -d; }; f" | |
bdone = "!f() { git switch ${1-main} && git up && git bclean ${1-main}; }; f" |
View .bashrc
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
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
case "$TERM" in | |
xterm*|rxvt*) | |
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\w\a\]$PS1" | |
;; |
NewerOlder