Skip to content

Instantly share code, notes, and snippets.

View xorxornop's full-sized avatar

Matt Ducker xorxornop

View GitHub Profile
@xorxornop
xorxornop / Microsoft.PowerShell_profile.ps1
Created June 2, 2018 13:43
Powershell profile 'subprofile' dot-sourcing functionality
# Any/all additional functionality desired for the profile may be added as seperate files in a subfolder (name specified below) for the sake of tidiness and ease of switching out functionality:
$subprofileScriptFolderName = "SubprofileScripts"
# Find any sub-profile scripts found in the relevant subfolder, should it exist and contain '*.ps1' scripts, and then dot-source each of them:
Resolve-Path -Path "$(Split-Path -Path $profile -Parent)\$subprofileScriptFolderName\*" | Where-Object {$_.Path.EndsWith(".ps1")} | ForEach-Object {
. $_.Path
}
@xorxornop
xorxornop / launch.json
Created March 25, 2018 04:31
Launch configuration for debugging Rust code inside VS Code with LLDB
{
// Launch configuration for debugging Rust code inside VS Code with LLDB
// This configuration is used by the extension 'LLDB Debugger'
//
// The necessary extension may be downloaded at: https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
// Alternatively, the repository for it may be found at: https://github.com/vadimcn/vscode-lldb.git
"version": "0.1.0",
"configurations": [
{
@xorxornop
xorxornop / keybase.md
Created February 5, 2018 16:56
Keybase identity proof

Keybase proof

I hereby claim:

  • I am xorxornop on github.
  • I am xorxornop (https://keybase.io/xorxornop) on keybase.
  • I have a public key ASCrV53FNE4O4hge9R4pPr5d_rtRXg7pxR30FzC2NVz9bQo

To claim this, I am signing this object:

@xorxornop
xorxornop / UpdateDynamicDNS-Namecheap.ps1
Last active March 4, 2021 05:20
Update Dynamic DNS record at Namecheap
<#
.Synopsis
Updates a Dyanmic DNS record at Namecheap
.Description
Updates a Dyanmic DNS subdomain record at Namecheap, auto-detecting the external IP address of the local host for assignment (or that of a supplied IP value)
.Example
# Named arguments:
PS C:\> .\UpdateDynamicDNS-Namecheap.ps1 -HostRecord 'thehost' -Domain 'thedomain.tld' -Key 'thekey'
PS C:\> .\UpdateDynamicDNS-Namecheap.ps1 -HostRecord 'thehost" -Domain 'thedomain.tld' -Key 'thekey' -IP '127.0.0.1'
PS C:\> .\UpdateDynamicDNS-Namecheap.ps1 -HostRecord 'thehost" -Domain 'thedomain.tld' -Key 'thekey' -IP '127.0.0.1' -ForceUpdate
@xorxornop
xorxornop / gist:96e1cb5db25c6054c02d
Last active August 29, 2015 14:19
Zip many enumerable item sources together
public static class ZipExtensions
{
/// <summary>
/// Zips items such that {A,D,G} and {B,E,H} and {C,F,I} => {A,B,C,D,E,F,G,H,I}.
/// </summary>
/// <typeparam name="T">Type of item.</typeparam>
/// <param name="sources">The sources of items to zip and order.</param>
/// <param name="exhaustative">
/// If set to <c>true</c>, when any source is exhausted of items,
/// processing continues with the remaining sources.