This file contains hidden or 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 string ShuffleStringExcludeOriginal(string stringToShuffle) | |
| { | |
| string shuffled; | |
| if (String.IsNullOrEmpty(stringToShuffle)) | |
| { | |
| throw new ArgumentNullException("stringToShuffle", | |
| "The stringToShuffle variable must not be null or empty"); | |
| } | |
This file contains hidden or 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 void MultipleSchemas() | |
| { | |
| var validator = new XsdValidator(); | |
| validator.AddSchema(@"SchemaDoc1.xsd"); | |
| validator.AddSchema(@"SchemaDoc2.xsd"); | |
| var isValid = validator.IsValid(@"ValidXmlDoc1.xml"); | |
| } |
This file contains hidden or 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
| --- | |
| ansible_port: 5986 | |
| ansible_connection: winrm | |
| ansible_winrm_server_cert_validation: ignore |
This file contains hidden or 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 in C:\users\[user]\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 | |
| # You may need to run `Set-ExecutionPolicy RemoteSigned` if you get an error about running | |
| # wingetlist requires the Microsoft.WinGet.Client module: Install-Module Microsoft.WinGet.Client -Scope CurrentUser | |
| function wingetlist { | |
| # Lists available winget upgrades, excluding packages you don't want touched. | |
| # Uses the Microsoft.WinGet.Client module (structured object output) instead | |
| # of scraping the text output of `winget upgrade`. | |
| # | |
| # Pass -u / -Upgrade to install the upgrades directly instead of just |
This file contains hidden or 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
| [Unit] | |
| Description=Notify via Pushover when a reboot is required | |
| Documentation=https://gist.github.com/Satal/f2a9ded88005fe8f573ea2725db0970b | |
| [Service] | |
| Type=oneshot | |
| User=satal | |
| ExecStart=/usr/local/bin/reboot-notify.sh | |
| SyslogIdentifier=reboot-notify |
This file contains hidden or 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
| # This goes at the end of .bashrc | |
| mkcd() { | |
| mkdir -p "$1" && cd "$1" | |
| } | |
| # Based on https://stackoverflow.com/a/23328996/465404 | |
| function lazygit() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: lazygit \"commit message\"" | |
| return 1 |
This file contains hidden or 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
| # Use the latest Ubuntu image as the base | |
| FROM ubuntu:latest | |
| # Update apt package list and install python3 and pip3 | |
| RUN apt-get update && \ | |
| apt-get install -y python3 python3-pip git && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Set the working directory in the container |
This file contains hidden or 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
| ^+w:: { ; Ctrl + Shift + W | |
| MsgBox("Hover your mouse over the window you want to resize, then press OK.") | |
| ; Get the window under the mouse | |
| MouseGetPos(, , &winID) | |
| WinGetPos(&x, &y, &width, &height, "ahk_id " winID) | |
| MsgBox("Current Size:`nWidth: " width "`nHeight: " height) | |
| ; Get new width |
This file contains hidden or 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
| #Requires -RunAsAdministrator | |
| <# | |
| .SYNOPSIS | |
| Compresses/shrinks a WSL2 virtual disk (VHDX) to reclaim unused space. | |
| .DESCRIPTION | |
| Cleans up inside WSL, trims free space, shuts down WSL, then compacts | |
| the VHDX file using either Optimize-VHD or diskpart as a fallback. | |
| .PARAMETER SkipCleanup | |
| Skip the internal WSL cleanup step (apt clean, temp files, Docker prune). | |
| .PARAMETER Distro |