Skip to content

Instantly share code, notes, and snippets.

@brettveenstra
brettveenstra / Dotnet_Background_Jobs
Created February 27, 2024 10:58 — forked from StevenTCramer/Dotnet_Background_Jobs
If you are queuing background jobs/work items today in your .NET applications, how are you doing it and what are you using it for?
David Fowler 🇧🇧🇺🇸💉💉💉 on Twitter: "If you are queuing background jobs/work items today in your .NET applications, how are you doing it and what are you using it for? #dotnet #aspnetcore" / Twitter
https://twitter.com/davidfowl/status/1442566223099666436
Background tasks with hosted services in ASP.NET Core | Microsoft Docs
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-6.0&tabs=visual-studio
Messaging that just works — RabbitMQ
https://www.rabbitmq.com/
.NET/C# Client API Guide — RabbitMQ
@brettveenstra
brettveenstra / win-dev-box.ps1
Last active November 6, 2021 15:44
Dev Box Starters
#-------------------------------------------------------------------------------#
# #
# This script installs all the stuff I need to develop the things I develop. #
# Run PowerShell with admin priveleges, type `env-windows`, and go make coffee. #
# #
# -James #
# #
# #
# ripped from: https://github.com/jamestharpe/windows-development-environment #
#-------------------------------------------------------------------------------#
@brettveenstra
brettveenstra / Sample.cs
Created March 13, 2020 18:47 — forked from marisks/Sample.cs
Improved Jimmy Bogard's ValueObject<T> which supports inheritance
// Ordinary
public class SimpleDto : ValueObject<SimpleDto>
{
public string Value { get; set; }
}
// With base class
public abstract class BaseDto<T> : ValueObject<T>
{
public string BaseValue { get; set; }
@brettveenstra
brettveenstra / machine.config.markdown
Created March 12, 2020 15:26 — forked from marcbarry/machine.config.markdown
Security hardening pointers for web.config and machine.config
Prevent applications running if debug=true
<system.web>
  <deployment retail="true"/>
</system.web>
@brettveenstra
brettveenstra / LICENSE.txt
Created August 22, 2019 11:37 — forked from jed/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@brettveenstra
brettveenstra / Program.cs
Created June 16, 2019 01:20 — forked from nblumhardt/Program.cs
Enrich.WithCaller()
using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using Serilog;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
namespace ConsoleApp24
@brettveenstra
brettveenstra / dupfinder.ps1
Created June 7, 2019 19:49 — forked from badmotorfinger/dupfinder.ps1
Use ReSharper command line tool dupFinder to produce a report of duplicated C# code
$reportFileName = 'dupfinder.html'
$dupFindLocation = 'C:\dev\tools\ReSharperCliTools\dupfinder.exe'
if (-not (Test-Path $dupFindLocation)) {
Write-Host "dupfinder.exe not found in path $dupFindLocation"
Write-Host "Download tools from https://www.jetbrains.com/help/resharper/2017.1/ReSharper_Command_Line_Tools.html"
exit
}
$xsl = '<?xml version="1.0" encoding="utf-8"?>
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten

Using P4Merge with Visual Studio 2015/2017

The diff tool integrated with Visual Studio has been improving with every version. I still prefer dedicated diff/merge tools for the job, however, and P4Merge is my favorite. This small guide describes how to properly integrate P4Merge with Visual Studio 2015.

Note that this only applies when using TFS. If you use git, Visual Studio will use the diff/merge tools configured with git.

Installing P4Merge

The easiest method of installing P4Merge on your computer is with Chocolatey:

@brettveenstra
brettveenstra / octo-artifacts.ps1
Created August 9, 2017 16:57 — forked from rirl/octo-artifacts.ps1
Download ALL artifacts for a given deployment from Octopus Deploy to the artifacts directory
# Try it in powershell...
[Reflection.Assembly]::LoadFile("C:\Program Files\Octopus Deploy\Tentacle\Newtonsoft.Json.dll")
[Reflection.Assembly]::LoadFile("C:\Program Files\Octopus Deploy\Tentacle\Octopus.Client.dll")
[Reflection.Assembly]::LoadFile("C:\Program Files\Octopus Deploy\Tentacle\Octopus.Platform.dll")
# Basic data
Write-Host "Setup..."
$octoKey=" Your API Key"
$octoUser=" Your user name"
$octoId=" Your deployment id, ie (deployments-1492)"