Skip to content

Instantly share code, notes, and snippets.

View deadlydog's full-sized avatar

Daniel Schroeder deadlydog

View GitHub Profile
@deadlydog
deadlydog / PowerShellUtilities.psm1
Last active October 7, 2024 14:10
Powershell Invoke-ScriptBlockWithRetries function to execute arbitrary PowerShell code and automatically retry if an error occurs
function Invoke-ScriptBlockWithRetries {
[CmdletBinding(DefaultParameterSetName = 'RetryNonTerminatingErrors')]
param (
[Parameter(Mandatory = $true, HelpMessage = "The script block to execute.")]
[ValidateNotNull()]
[scriptblock] $ScriptBlock,
[Parameter(Mandatory = $false, HelpMessage = "The maximum number of times to attempt the script block when it returns an error.")]
[ValidateRange(1, [int]::MaxValue)]
[int] $MaxNumberOfAttempts = 5,
@deadlydog
deadlydog / NewApplicationOrServiceChecklist.md
Last active August 30, 2020 16:54
Things every application / service should have

Things to include in every application / service

Some things that every application or service you build should have:

  • Logging (preferably centralized)
  • Metrics (to know how the app is performing (slow endpoints, etc.))
  • Alerts (to be notified when things aren't working properly)
  • Telemetry (to know which parts of the app / service are used most, or not at all and can be removed)
  • User Feedback Mechanism (so users can easily report issues or request new features)
  • Feature Flags (to enable rolling features / changes out in a controlled manner)
@deadlydog
deadlydog / Repository's .editorconfig file
Last active March 12, 2024 21:04
This .editorconfig file should live in the repository and be committed to source control. This file should not contain personal preference settings like `indent_size`, as those should be specified in a parent .editorconfig file outside of the repository.
# This file should only include settings that affect the physical contents of the file, not just how it appears in an editor.
# Do not include personal preference presentation settings like a tab's `indent_size` in this file; those should be specified
# in a parent .editorconfig file outside of the repository.
# v1.7 - Source: https://gist.github.com/deadlydog/bd000162e85c155b243a712c16f7411c
# Ensure that personal preference presentation settings can be inherited from parent .editorconfig files.
root = false
#### Core EditorConfig Options ####