Skip to content

Instantly share code, notes, and snippets.

View mgaffigan's full-sized avatar

Mitch Gaffigan mgaffigan

View GitHub Profile
@mgaffigan
mgaffigan / stamp.js
Created November 12, 2025 00:36
Stamp a PDF in Mirth
var PDDocument = org.apache.pdfbox.pdmodel.PDDocument;
var PDPage = org.apache.pdfbox.pdmodel.PDPage;
var PDPageContentStream = org.apache.pdfbox.pdmodel.PDPageContentStream;
var PDType1Font = org.apache.pdfbox.pdmodel.font.PDType1Font;
var Standard14Fonts = org.apache.pdfbox.pdmodel.font.Standard14Fonts;
var PDImageXObject = org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
var PDFTextStripper = org.apache.pdfbox.text.PDFTextStripper;
var TextPosition = org.apache.pdfbox.text.TextPosition;
var File = java.io.File;
var HashMap = java.util.HashMap;
@mgaffigan
mgaffigan / mirth-server.py
Created June 11, 2025 02:58
Mirth Server Launch Script
import os
import sys
import re
def substitute_env_vars(s: str) -> str:
"""
Substitutes `${VAR_NAME}` patterns within a given string `s`.
"""
def replace_match(match) -> str:
var_name = match.group(1)
@mgaffigan
mgaffigan / MainWindow.xaml
Last active March 8, 2025 19:03
WPF OutlookBar panel
<Window x:Class="OutlookBarPanelTest.MainWindow" x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:OutlookBarPanelTest"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="300">
<Window.Resources>
<Style x:Key="OutlookBarItemBorderStyle" TargetType="Border">
@mgaffigan
mgaffigan / WSTrust on NetCore.cs
Last active March 4, 2024 21:02
Example of using System.ServiceModel.Federation with Windows Integrated Auth on net8.0 and net48
using System;
#if NET
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Federation;
using Microsoft.IdentityModel.Protocols.WsTrust;
using Microsoft.IdentityModel.Protocols.WsPolicy;
using Microsoft.IdentityModel.Protocols.WsAddressing;
@mgaffigan
mgaffigan / Example.txt
Created January 12, 2024 16:41
Example of net48 target from sdk style project.
PS C:\dev\source\repos\SdkStyleNet48\SdkStyleNet48> dotnet run
Hello, World from 4.0.30319.42000!
PS C:\dev\source\repos\SdkStyleNet48\SdkStyleNet48> dotnet build
MSBuild version 17.7.3+8ec440e68 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
SdkStyleNet48 -> C:\dev\source\repos\SdkStyleNet48\SdkStyleNet48\bin\Debug\net48\SdkStyleNet48.exe
Build succeeded.
0 Warning(s)
@mgaffigan
mgaffigan / vue example.html
Created November 22, 2019 03:56
Example of using Vue to have a dynamic set of combo boxes
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello, world!</title>
</head>
<body>
<section class="regionapp">
<header class="header">
<h1>regions</h1>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello, world!</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>Example of a variable number of combo boxes</p>
<form>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello, world!</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>Example of a variable number of combo boxes</p>
<form>
@mgaffigan
mgaffigan / sox-layer-node10.zip
Last active October 29, 2019 17:24
Lambda SOX Layer for node 10
This file has been truncated, but you can view the full file.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace StripJabberTelUri
{