Skip to content

Instantly share code, notes, and snippets.

View zacpwhite's full-sized avatar

Zac White zacpwhite

View GitHub Profile
@Josrph
Josrph / RefitRouteAnalyzer.cs
Last active March 10, 2025 21:17
Roslyn-based Refit Route Analyzer.
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class RefitRouteAnalyzer : DiagnosticAnalyzer
{
private const string Category = "Routing";
public const string DiagnosticId = "RefitRouteAnalyzer";
private static readonly DiagnosticDescriptor AttributeRule = new DiagnosticDescriptor(
DiagnosticId,
title: "Route string should match method signature",
messageFormat: "Attribute name '{0}' contains incorrect route",
@jeffjohnson9046
jeffjohnson9046 / git-ignore.sh
Created August 11, 2015 21:02
Remove unwanted files from a git repo AFTER adding a .gitignore. The files will remain on disk.
## I just ran into this after initializing a Visual Studio project _before_ adding a .gitignore file (like an idiot).
## I felt real dumb commiting a bunch of files I didn't need to, so the commands below should do the trick. The first two commands
## came from the second answer on this post: http://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files
# See the unwanted files:
git ls-files -ci --exclude-standard
# Remove the unwanted files:
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached