Skip to content

Instantly share code, notes, and snippets.

function projects() {
Set-Location -Path C:\Projects
}
function github() {
Set-Location -Path C:\Projects\GitHub
}
function unresolve() {
git checkout --conflict=merge --
@kdowswell
kdowswell / choco.install.ps1
Last active April 25, 2022 13:04
Windows 10 Visual Studio + VS Code Developer PC Setup
#NOTE: Install Chocolatey https://chocolatey.org/install#individual
#NOTE: must run PowerShell as administrator
#NOTE: must run 'Set-ExecutionPolicy Unrestricted' before executing this script
chocolatey feature enable -n allowGlobalConfirmation
choco install visualstudio2022professional --package-parameters "--passive --locale en-US"
# Examples for VS install flags https://github.com/jberezanski/ChocolateyPackages/blob/master/chocolatey-visualstudio.extension/EXAMPLES.md
# --allWorkloads --includeRecommended --includeOptional
This file has been truncated, but you can view the full file.
/*!
* Font Awesome Pro 5.3.1 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Commercial License)
*/
(function () {
'use strict';
var _WINDOW = {};
try {
if (typeof window !== 'undefined') _WINDOW = window;
Golf Caddie does not store any personal information.
@kdowswell
kdowswell / SitePages.tt
Last active September 9, 2017 06:10
ASP.NET Core Razor Pages tt file to generate a site page class. Based on https://gist.github.com/niaher/bfa87f0aeda1204091fe
// This is an auto-generated file.
<#@ template language="C#" hostSpecific="true" debug="True" #>
<#@ output extension="cs" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDte" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="System" #>
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
Disable-InternetExplorerESC
/// <summary>
/// Decorator that applies save changes after a command is successfully run
/// </summary>
/// <typeparam name="TCommand"></typeparam>
public class TransactionalCommandHandlerDecorator<TCommand> : ICommandHandler<TCommand> where TCommand : CommandBase
{
private readonly IDbContext _context;
private readonly ICommandHandler<TCommand> _decoratedCommandHandler;
public TransactionalCommandHandlerDecorator(IDbContext context, ICommandHandler<TCommand> decoratedCommandHandler)
/// <summary>
/// Decorator that applies save changes after a command is successfully run
/// </summary>
/// <typeparam name="TRequest"></typeparam>
/// <typeparam name="TResponse"></typeparam>
public class TransactionalHandler<TRequest, TResponse>
: IRequestHandler<TRequest, TResponse>
where TRequest : IRequest<TResponse>
{
private readonly IAfaemsDbContext _context;
public class Mediator : IMediator
{
private readonly IContainer _container;
public Mediator(IContainer container)
{
_container = container;
}
public void Send<TCommand>(TCommand command) where TCommand : ICommand
public class AccountController : BaseController {...}
[HandleCustomException]
public abstract class BaseController : Controller {...}