Skip to content

Instantly share code, notes, and snippets.

View mwwhited's full-sized avatar

Matthew Whited mwwhited

View GitHub Profile
@mwwhited
mwwhited / Directory.Build.props
Last active February 2, 2024 22:51
Custom build extensions for .Net
<Project>
<PropertyGroup Condition="'$(SolutionDir)' == ''">
<!-- Resolve solution dir if not set -->
<SolutionDir Condition="'$(SolutionDir)' == '' and $([System.IO.Directory]::GetFiles('../', '*.sln').get_Length()) != 0">../</SolutionDir>
<SolutionDir Condition="'$(SolutionDir)' == '' and $([System.IO.Directory]::GetFiles('../../', '*.sln').get_Length()) != 0">../../</SolutionDir>
<SolutionDir Condition="'$(SolutionDir)' == '' and $([System.IO.Directory]::GetFiles('../../../', '*.sln').get_Length()) != 0">../../../</SolutionDir>
<SolutionDir Condition="'$(SolutionDir)' == '' and $([System.IO.Directory]::GetFiles('../../../../', '*.sln').get_Length()) != 0">../../../../</SolutionDir>
<SolutionDir Condition="'$(SolutionDir)' == '' and $([System.IO.Directory]::GetFiles('../../../../../', '*.sln').get_Length()) != 0">../../../../../</SolutionDir>
<SolutionDir Condition="'$(SolutionDir)' != ''">$([System.IO.Path]::GetFullPath('$(SolutionDir)'))</SolutionDir>
@mwwhited
mwwhited / run-sonar.bat
Last active February 2, 2024 22:57
Local SonarQube
SET SONARQUBE_KEY=XXX
SET SONARQUBE_TOKEN=YYY
dotnet tool restore
echo "Git fetch"
git fetch --prune
FOR /F "tokens=* USEBACKQ" %%g IN (`dotnet gitversion /output json /showvariable FullSemVer`) DO (SET BUILD_VERSION=%%g)
if "%BUILD_VERSION%"=="" GOTO error
@mwwhited
mwwhited / .gitconfig
Created February 1, 2024 18:12
.gitconfig for beyond compare 4
[credential "https://source.developers.google.com"]
useHttpPath = true
[user]
name = Matthew Whited
email = matt@whited.us
[core]
excludesfile =
[difftool "sourcetree"]
cmd = '' \"$LOCAL\" \"$REMOTE\"
[mergetool "sourcetree"]
@mwwhited
mwwhited / .wslconfig
Last active February 1, 2024 01:19
Preferred Settings for WSL2
# %USERPROFILE%\.wslconfig
# https://learn.microsoft.com/en-us/windows/wsl/wsl-config
[wsl2]
# If the value is mirrored then this turns on mirrored networking mode. Default or unrecognized strings result in NAT networking.
networkingMode=mirrored
# Only applicable when experimental.networkingMode is set to mirrored. When set to True, will allow the Container to connect to
# the Host, or the Host to connect to the Container, by an IP address that's assigned to the Host. Note that the 127.0.0.1
# loopback address can always be used - this option allows for all additionally assigned local IP addresses to be used as well.
@mwwhited
mwwhited / .editorconfig
Created January 28, 2024 03:31
My favorite csharp .editorconfig settings
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
DECLARE @SchemaName SYSNAME = 'Core_DocumentManagement';
SELECT
--'entity "' + schemas.name + '.' + tables.name + '" as ' + tables.name + ' {' + CHAR(10) +
'entity ' + tables.name + ' {' + CHAR(10) +
(SELECT
STRING_AGG(
' ' + columns.name + ' : ' + UPPER(types.name) +
ISNULL(CASE
WHEN types.name IN ('varchar', 'nvarchar', 'char', 'nchar')

Create Network Backup for HomeSeer

Summary

This is a simplified set of instructions to mount a network share that can be used to backup HS4-pi

Details

  1. Create NFS share on desired server.
  2. log into the terminal on HS4 and mount the NFS share
@mwwhited
mwwhited / eclipse-format.xml
Created January 2, 2022 02:10 — forked from snipsnipsnip/eclipse-format.xml
C#-like eclipse code format settings
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="11">
<profile kind="CodeFormatterProfile" name="C#-like" version="11">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
@mwwhited
mwwhited / AzureDevopsBranchTagging.md
Created August 21, 2021 03:47
Azure Deops Tag Branch on Build

Azure DevOps Pipeline Branch Tagging

Summary

It is possible to git repositories in Azure Devops as part of your automated build process.

Build Scripts

Manually checkout your git repository need the beginning of your job. Ensure to persist credentials so you can authenticate against git later.

@mwwhited
mwwhited / SQL Table as Queue.md
Last active April 8, 2021 17:49
SQL Table as Queue

Simple TSQL Table as Queue

Show unlocked events

SELECT
	*
FROM dbo.queue WITH (READPAST)
;