Skip to content

Instantly share code, notes, and snippets.

View treymack's full-sized avatar

Trey Mack treymack

View GitHub Profile
@treymack
treymack / CCSD 2023-2024 Academic Calendar.csv
Created March 31, 2023 02:45
Charleston County School District (CCSD) 2023-2024 Academic Calendar - Google Calendar Import
Start Date Subject End Date
2023-08-16 Teacher Workday/Professional Development 2023-08-19
2023-08-18 Elementary Professional Development/Secondary Teacher Workday
2023-08-21 Secondary Professional Development/Elementary Teacher Workday
2023-08-22 Teacher Workday/Professional Development
2023-08-23 First Day of School for Students
2023-08-28 First Day of staggered entry for Head Start/Child Development; First Day of School for Early Head Start/PIC
2023-09-04 Holiday – Labor Day (Schools and Offices Closed)
2023-09-22 Early Release (Teacher Workday)
2023-09-25 Progress Reports Distributed This Week
@treymack
treymack / GqlSchema.cs
Last active May 22, 2022 15:07
Generate SDL in a unit test and check for changes against the last SDL built (using Verify). Can use this example to generate SDL at build time too.
using HotChocolate.Execution;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Template._1.Gql.Tests;
[UsesVerify]
public class GqlSchema
{
@treymack
treymack / base-mindmap.puml
Created June 20, 2021 17:59
PlantUML Styles
!include base.puml
!$CONF_DARK_BLUE = '#172B4D'
!$CONF_WHITE = '#FFFFFF'
!$CONF_GREY_BACKGROUND_COLOR = '#F4F5F7'
!$CONF_LIGHT_GREY_BACKGROUND_COLOR = '#FAFBFC'
!$CONF_GREY_BORDER_COLOR = '#C1C7D0'
!$CONF_WELL_GREEN_BACKGROUND_COLOR = '#F3F9F4'
[Test]
public void AssertValidMappings()
{
using (var db = TestDatabase.Create())
using (var session = SessionFactory.Instance.OpenSession(db.Connection))
{
var entityTypes = from a in new[] { typeof(Domain.Entities.Clients).Assembly }
from t in a.ExportedTypes
where typeof(Domain.Abstract.IEntity).IsAssignableFrom(t)
where !t.IsAbstract
using Hangfire;
using Hangfire.Client;
using Hangfire.Common;
using System;
using System.Collections.Generic;
using System.Linq;
namespace HangfireDemo.Filters
{
public class CancelPendingJobsAttribute : JobFilterAttribute, IClientFilter
@treymack
treymack / readme.md
Last active October 29, 2022 11:07
DbUp Migration Strategy

Motivation

There were a couple of issues we encountered over the years using FluentMigrator.

Order of Migrations not easily visible

The ordering of Migrations in FM depended on an Attribute on the Migration class, taking a long to use when sorting. By convention, this was to represent a timestamp at a particular precision (yyyyMMddhhmm), but that wasn't always followed. Additionally, we got out of sync on the precision to use. Since this was represented as a long, 20150102120059 would be sorted after 201501011200, which wasn't the intent.

Changes to Stored Procs / Functions / Views not easily visible

@treymack
treymack / kill-node-modules.bat
Created January 23, 2017 17:28
A way to remove the node_modules folder on windows even if file paths are too long to delete through Windows Explorer.
cd %~dp0
mkdir empty_dir
robocopy empty_dir node_modules /MIR
del /q node_modules
del /q empty_dir
@treymack
treymack / demo.ps1
Created April 19, 2016 16:22
CD to the folder of any command in your path with PoSH
gcm git | select Path | Split-Path | cd
@treymack
treymack / StaticReflection.cs
Created January 8, 2016 04:48
StaticReflection.cs
/// <summary>
/// http://joelabrahamsson.com/getting-property-and-method-names-using-static-reflection-in-c/
/// </summary>
public static class StaticReflection
{
public static string GetMemberName<T, TValue>(
this T instance,
Expression<Func<T, TValue>> expression)
{
return GetMemberName(expression);
@treymack
treymack / IStructurallyIdentifiable.cs
Last active January 8, 2016 14:15
C# Equality Determined by Subset of Properties
public interface IStructurallyIdentifiable<T> : IEquatable<T>
{
IEnumerable<Expression<Func<T, object>>> GetIdentityProperties();
}