Skip to content

Instantly share code, notes, and snippets.

@markgarrigan
markgarrigan / copilot-instructions.md
Created August 6, 2025 13:21
Example Copilot Instruction File

Project Overview

This project involves building predictive models to analyze customer churn using Python, pandas, scikit-learn, and XGBoost. It includes data preprocessing, feature engineering, model training, and evaluation.

Folder Structure

  • /data: Contains raw and processed datasets. Raw data should not be committed.
  • /notebooks: Jupyter notebooks for exploratory data analysis and prototyping.
  • /src: Python scripts for data processing, modeling, and evaluation.
  • /models: Saved model artifacts.
  • /reports: Generated reports and visualizations.
@markgarrigan
markgarrigan / gh-action-ui.md
Last active July 29, 2025 20:55
Github Action Interaction

GitHub Actions Requirements: UI Integration

1. UI-Initiated Shutdown Override

  • The UI must have the ability to override (skip) the next scheduled shutdown without modifying the schedule itself.
  • The GitHub Actions must provide a workflow dispatch or endpoint that:
    • Accepts a request from the UI to override the next scheduled shutdown.
    • Ensures the scheduled shutdown does not execute for the upcoming window (but does not affect future scheduled shutdowns).
    • Optionally, clears the override after the scheduled shutdown time has passed (so future shutdowns happen as normal).
  • Returns confirmation of the override action.
const axios = require('axios');
const RALLY_API_HOST = 'https://rally1.rallydev.com'
const RALLY_API_PATH = `/slm/webservice/v2.0`
const RALLY_WORKSPACE = '4729135433'
const RALLY_PROJECT = {
pidi: 344842856592, // 5 - PIDI Intake
dss: 89480156508, // AS DS - Infrastructure
}
@markgarrigan
markgarrigan / definitions.js
Last active June 20, 2025 20:17
Markdown docs site in Angular App
/**
* @typedef TOCItem
* @property {number} level.required - Heading level (1 for h1, 2 for h2, etc.)
* @property {string} text.required - Text of the heading
* @property {string} slug.required - Slugified ID used for anchor navigation
*/
/**
* @typedef PatternIndexItem
* @property {number} id.required - Unique identifier for the page
app.get('/auth/github', (req, res) => {
const redirectUri = req.query.redirect_uri || '/';
req.session.redirectUri = redirectUri;
const params = new URLSearchParams({
client_id: process.env.GITHUB_CLIENT_ID,
redirect_uri: 'http://localhost:3000/auth/github/callback',
scope: 'read:user user:email',
allow_signup: 'true',
});
@markgarrigan
markgarrigan / azauth
Last active April 4, 2025 11:06
Using axios for azure auth
app.get('/auth/microsoft', (req, res) => {
const redirectUri = 'http://localhost:3000/auth/microsoft/callback'; // This must match the app registration
const finalRedirect = req.query.redirect_uri || '/';
req.session.redirectUri = finalRedirect;
const params = new URLSearchParams({
client_id: process.env.MICROSOFT_CLIENT_ID,
response_type: 'code',
redirect_uri: redirectUri,
scope: 'openid profile offline_access https://graph.microsoft.com/.default',
function dev() {
local home="$HOME"
local dir
dir=$(find "$home" -type d \( \
-path "$home/Music" -o \
-path "$home/Library" -o \
-path "$home/Downloads" -o \
-path "$home/Desktop" -o \
-path "$home/Documents" -o \
@markgarrigan
markgarrigan / .zshrc
Last active March 28, 2025 17:23
Kitty Tabs
function dev() {
local dir="${1:-$PWD}"
dir="$(realpath "$dir")"
if [[ ! -d "$dir" ]]; then
echo "Directory does not exist: $dir"
return 1
fi
local session_file
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, forkJoin, of } from 'rxjs';
import { switchMap, map, catchError } from 'rxjs/operators';
@Injectable({
providedIn: 'root',
})
export class GithubService {
private apiUrl = 'https://api.github.com';
@markgarrigan
markgarrigan / creds.json
Created January 7, 2025 18:36
Github Action Azure Login json
{
"clientId": "xxxxx-xxxxx-xxxxx-xxxxx",
"clientSecret": "xxxxx-xxxxx-xxxxx-xxxxx",
"subscriptionId": "xxxxx-xxxxx-xxxxx-xxxxx",
"tenantId": "xxxxx-xxxxx-xxxxx-xxxxx",
"activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
"resourceManagerEndpointUrl": "https://management.azure.com/",
"activeDirectoryGraphResourceId": "https://graph.windows.net/",
"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
"galleryEndpointUrl": "https://gallery.azure.com/",