Skip to content

Instantly share code, notes, and snippets.

@DanElliott
DanElliott / health-checks.ps1
Created March 1, 2024 20:17
A PowerShell health check script
$urls = @("http://example.com", "http://example2.com") # Add the URLs you want to check here
foreach ($url in $urls) {
try {
$response = Invoke-WebRequest -Uri $url
if ($response.StatusCode -eq 200) {
Write-Host "Website $url is up and running."
} else {
Write-Host "Website $url is not responding properly. Status code: $($response.StatusCode)"
}
@DanElliott
DanElliott / AssemblyInformation.cs
Created January 29, 2024 22:42
Simple way to access assembly attributes
namespace MyApp;
using System.Reflection;
public record class AssemblyInformation(string Product, string Description, string Version, string InformationalVersion)
{
public static readonly AssemblyInformation Current = new(typeof(AssemblyInformation).Assembly);
public AssemblyInformation(Assembly assembly)
: this(
@DanElliott
DanElliott / opensports-embed.html
Created November 28, 2023 16:38
OpenSports Embed
<a class="os-iframe-link" href="https://embed.opensports.net/iframe/events?aliasID=PhiladelphiaVolleyball"></a>
<script src="https://embed.opensports.net/dist/iframe.min.js"></script>

IIS Configuration

To use pass through authentication

Grant site folder the following permissions to IIS_IUSRS:

  • Full control
  • Modify
  • Read & execute
  • List folder contents
@DanElliott
DanElliott / ClassGenerator.sql
Created July 24, 2019 12:03 — forked from gionnani/ClassGenerator.sql
Generate C# class from database table
--modified from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table
--added table and column
declare @TableName sysname = 'TableName'
declare @Result varchar(max) = '[Table(Name = "' + @TableName + '")]
public class ' + @TableName + '
{'
select @Result = @Result + '
[Column(DbType = "' +
@DanElliott
DanElliott / README-Template.md
Created October 31, 2018 12:28 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@DanElliott
DanElliott / ActivePageTagHelper.cs
Last active July 13, 2023 21:10 — forked from bjcull/ActiveRouteTagHelper.cs
Adds an "active" class to the given element when the route parameters match. An Active Page Tag Helper for use with Razor Pages.
[HtmlTargetElement(Attributes = "is-active-page")]
public class ActivePageTagHelper : TagHelper
{
/// <summary>The name of the action method.</summary>
/// <remarks>Must be <c>null</c> if <see cref="P:Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper.Route" /> is non-<c>null</c>.</remarks>
[HtmlAttributeName("asp-page")]
public string Page { get; set; }
/// <summary>
/// Gets or sets the <see cref="T:Microsoft.AspNetCore.Mvc.Rendering.ViewContext" /> for the current request.