Skip to content

Instantly share code, notes, and snippets.

View michaellperry's full-sized avatar

Michael L Perry michaellperry

View GitHub Profile
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace StatisticalLinq
{
[TestClass]
public class VarianceTest
{
[TestMethod]
public void VarianceOf10Numbers()
@michaellperry
michaellperry / model.fact
Created November 16, 2012 22:11
Minimal Correspondence model
namespace MyFriends;
fact Individual {
key:
string anonymousId;
query:
Friend* friends {
Friend f : f.individual = this
}
@michaellperry
michaellperry / chocolateyInstall.ps1
Last active August 29, 2015 14:07
Chocolatey packages for developer workstation
choco install beyondcompare
choco install TimRayburn.GitAliases
choco install gittfs
choco install mysql
choco install mysql.workbench
choco install notepadplusplus
choco install paint.net
choco install windirstat
choco install ruby
choco install fiddler
Install-WindowsUpdate -acceptEula
public static class DbSetExtensions
{
public static void AddOrUpdateFaster<TEntity>(
this DbSet<TEntity> set,
Expression<Func<TEntity, int>> identifierExpression,
IEqualityComparer<TEntity> entityComparer,
params TEntity[] entities)
where TEntity : class
{
var identifierFunction = identifierExpression.Compile();
@michaellperry
michaellperry / GitAliases.sh
Last active August 5, 2023 17:37 — forked from trayburn/GitAliases.sh
Tim Rayburn's GIT Aliases
git config --global alias.a 'add -A'
git config --global alias.b 'branch'
git config --global alias.c 'checkout'
git config --global alias.cb 'checkout -b'
git config --global alias.d 'diff'
git config --global alias.f 'fetch'
git config --global alias.l 'log --pretty=oneline --abbrev-commit'
git config --global alias.r 'rebase --interactive HEAD~10'
git config --global alias.s '-p status'
@michaellperry
michaellperry / upgrade_gatsby.sh
Created April 10, 2022 14:03
Upgrade gatsby.js and all plugins to the latest version
cat package.json | jq -r '.dependencies | keys | map(select(startswith("gatsby")) | "\(.)@latest") | join(" ")' | xargs npm
i
@michaellperry
michaellperry / documentation-structure.mdc
Last active August 24, 2025 22:03
Cursor rule for project documentation structure
---
description: "Documentation structure standards for organizing project documentation into logical sections including implementation plans, technical architecture, user guides, and setup documentation. Emphasizes critical plan file requirements with progress tracking, checklists, phased work breakdowns, and project management focus. Includes file naming conventions, markdown formatting standards, content organization guidelines, and version control practices for maintaining documentation quality."
alwaysApply: true
---
# Documentation Structure and Standards
## Overview
The `/docs` folder contains comprehensive documentation for the project, organized into logical sections for different types of documentation and audiences.
## Documentation Structure
@michaellperry
michaellperry / implement.mdc
Last active September 1, 2025 23:30
Cursor rule to implement a section of a plan
---
alwaysApply: false
---
# Implementation Rule
## Requirements
Review the mentioned section of the plan against the current application as implemented. Identify any issues, inconsistencies, or points of confusion.
## Clarification Process
If the instructions are unclear:
@michaellperry
michaellperry / fix_frontmatter.py
Last active August 24, 2025 23:12
Python script to fix the frontmatter errors introduced by Cursor's /Generate Cursor Rules command
#!/usr/bin/env python3
"""
Script to fix frontmatter placement issues in .mdc files within .cursor/rules directory.
Moves misplaced frontmatter from the bottom of files to the top where it belongs.
"""
import os
import re
import shutil
from pathlib import Path