Skip to content

Instantly share code, notes, and snippets.

View LanceMcCarthy's full-sized avatar
💾
Bashing bugs (ง'̀-'́)ง

Lance McCarthy LanceMcCarthy

💾
Bashing bugs (ง'̀-'́)ง
View GitHub Profile
@LanceMcCarthy
LanceMcCarthy / readme.md
Created July 8, 2026 22:15
House Info and Rules - Summer Vacay!

Hi fam, here are the house details and rules. Please respect them, any violation here will go on my record and severely hurt my AirBnb record.. which also hurts my & Irina's ability to host in Costa Rica.

Main Rules

  • Address
    • 124 Boulder Path Road, Waterville Valley, NH, 03215, US.
  • Checkin
    • The code to enter the property is 3686. This code will open the smart lock which is the round lock to the right of the green door. Instructions on how to use the smart lock are posted directly above it.
    • Check in anytime after 4:00 PM and your unique code is set to begin working at this time.
  • WiFi Network:
  • SSID: Red Husky Rentals Guest
@LanceMcCarthy
LanceMcCarthy / hello.md
Created February 12, 2024 20:59
Env Tips

To determine where an environment variable is set, you can follow these steps:

  1. Environment Variables Dialog:

    • Press Win + R to open the Run dialog.
    • Type sysdm.cpl and hit Enter.
    • Go to the Advanced tab and click the Environment Variables button.
    • Here, you'll find both user-specific and system-wide environment variables. You can view, edit, or delete them.
  2. Registry Editor:

    • Open the Registry Editor by pressing Win + R, typing regedit, and hitting Enter.
@LanceMcCarthy
LanceMcCarthy / README.md
Last active May 7, 2025 19:25
VS Live Episode: Resources for Publishing .NET MAUI Projects

.NET MAUI Publishing Resources

So you're done building your .NET MAUI application, congrats! Now it's time to publish them, This can be a tricky topic to navigate, even to dedicated DevOps engineers who do this regularly because of the number of moving pieces in the puzzle.

To help you, I have combined several resources that are a great place to get started. These are not only a good Getting Started experience, but it's also a good thing to bookmark as a quick look-up reference.

Table of Contents

@LanceMcCarthy
LanceMcCarthy / YourMauiApp.csproj
Last active May 2, 2023 23:53
An example csproj that shows how to use conditionalsfor publishing settings
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Hacked.Maui</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
@LanceMcCarthy
LanceMcCarthy / MauiProgram.cs
Last active May 20, 2026 05:57
Mica support in .NET MAUI
// ************************************************************************ //
// This implementation is inspired from the official WinUI3 backdrops examples
// https://github.com/microsoft/WinUI-Gallery/blob/winui3/XamlControlsGallery/ControlPagesSampleCode/SystemBackdrops/SystemBackdropsSample2.txt
// *********************************************************************** //
using Microsoft.Maui.LifecycleEvents;
#if WINDOWS10_0_17763_0_OR_GREATER
// The namespace of where the WindowsHelpers class resides
// In older versions of .NET MAUI, this was
@LanceMcCarthy
LanceMcCarthy / Example_A.MauiProgram.cs
Last active August 30, 2022 05:40
MAUI Window Position and Size (WinUI3 and MacCatalyst)
// ******** WinUI3 Window management ******** //
using Microsoft.Maui.LifecycleEvents;
#if WINDOWS
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Windows.Graphics;
#endif
namespace MyApp.Maui
@LanceMcCarthy
LanceMcCarthy / sensors.yaml
Created August 8, 2021 15:25
Tesla Powerwall Energy Sensor Template for HomeAssistant
# This template reports three values to Home Assistant through: grid_import, grid_export and solar_production sensors
- platform: template
sensors:
grid_import:
value_template: "{{state_attr('sensor.powerwall_site_now', 'energy_exported_(in_kW)')}}"
unit_of_measurement: kWh
device_class: energy
attribute_templates:
last_reset: "1970-01-01T00:00:00+00:00"
state_class: "measurement"
@LanceMcCarthy
LanceMcCarthy / MainWindow.xaml
Created August 4, 2021 18:19
A WPF control that stacks a TextBox and a TextBlock togetther
<Window x:Class="YourApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:YourApp"
Title="MainWindow" Height="350" Width="525">
<Grid>
<local:TextSandwichControl Text="I'm in the textbox"
HeaderText="I'm the label"
Margin="10"/>
@LanceMcCarthy
LanceMcCarthy / Clean_Bin_Obj_Zip.ps1
Created July 26, 2021 18:14
Clean up bin obj packages
# PowerShell script that recursively deletes all 'bin' and 'obj' (or any other specified) folders inside current folder
$CurrentPath = (Get-Location -PSProvider FileSystem).ProviderPath
# recursively get all folders matching given includes, except ignored folders
$FoldersToRemove = Get-ChildItem .\ -include bin,obj,*.zip -Recurse | Where-Object {$_ -notmatch '_tools' -and $_ -notmatch '_build'} | ForEach-Object {$_.fullname}
# recursively get all folders matching given includes
$AllFolders = Get-ChildItem .\ -include bin,obj,*.zip -Recurse | ForEach-Object {$_.fullname}
# subtract arrays to calculate ignored ones
@LanceMcCarthy
LanceMcCarthy / vpn-config-updater.sh
Last active September 30, 2024 13:28
UDM Pro IPsec VPN Configuration Updater
#!/bin/sh
# ***** warning ***** warning ***** warning ***** warning ***** warning ***** warning *****
# THIS IS NOT LONGER A GOOD APPROACH TO USE. SCROLL DOWN TO THE COMMENTS TO SEE HOW YOU CAN USE WIREGUARD WITH A DDNS FQDN INSTEAD
# ***** warning ***** warning ***** warning ***** warning ***** warning ***** warning *****
# ___ ____ _ _ _ _
# |_ _| _ \ ___ ___ ___ | | | |_ __ __| | __ _| |_ ___ _ __