Skip to content

Instantly share code, notes, and snippets.

View Hona's full-sized avatar

Luke Parker Hona

View GitHub Profile
@Hona
Hona / Program.cs
Created May 29, 2025 00:10
Fix mildly corrupt PDFs by doing a PDF to IMG to PDF conversion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
// Top-level statements for the console application
if (args.Length < 2)
{
You will be acting as a senior software engineer performing a code review for a colleague.

You will follow the guidelines for giving a great code review outlined below: https://google.github.io/eng-practices/review/reviewer/looking-for.html

You will follow the code style and standards very similar to that of Microsoft and other high quality .NET codebases. https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md

$file = "src/path/mything.cs"
$outputFile = "file_history.csv"
"Date,Commit,Lines" | Out-File $outputFile
$log = git log --follow --name-status --pretty=format:"COMMIT:%H:%ad" --date=short -- "$file"
$currentPath = $file
foreach ($line in $log) {
if ($line.StartsWith("COMMIT:")) {
@Hona
Hona / SYSTEM_PROMPT.md
Last active June 25, 2025 08:13
Best System Prompt for developers

<user_system_prompt>

Role & Expertise: Act as a peer Principal Engineer (MS Stack: .NET 9+, ASP.NET Core, EF Core, SQL Server, Azure). Assume expert level; emulate Fowler/Hanselman technical depth.

Core Principles:

  • Code: Production-ready (secure, scalable, maintainable, clear). Prioritize YAGNI, simplicity, speed (startup mindset). Ship early/often.
  • Interaction: Succinct, direct, laconic. Minimal text. Assume follow-ups if needed. No basic explanations.
  • Focus: Address ONLY the specific task. Provide concise, elegant solutions with minimal code changes.

Code Output Requirements:

@Hona
Hona / nuke.sql
Created January 21, 2025 03:10
Localhost SQL server is tanked? Nuke everything
USE master;
GO
SET NOCOUNT ON;
BEGIN TRY
-- Instance cleanup
DBCC FREEPROCCACHE WITH NO_INFOMSGS;
DBCC DROPCLEANBUFFERS WITH NO_INFOMSGS;
DBCC FREESYSTEMCACHE ('ALL') WITH NO_INFOMSGS;
:: Script by Hona
:: Get the latest updates from the Gist below
:: https://gist.github.com/Hona/04d66029cd4a5ff53ca245280bd9e5e3
@echo off
cls
set "profile=PowerShell"
set "apiPath=.\src\WebAPI\MyApp.WebApi"
set "uiPath=.\src\WebUI\MyApp.WebUI"
@Hona
Hona / Program.cs
Created June 14, 2024 06:01
Tempus Author Tier List Generator
using System.Diagnostics;
using Microsoft.Win32;
using SixLabors.Fonts;
using TempusApi;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Drawing.Processing;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
var tempus = new TempusClient(new HttpClient());