Skip to content

Instantly share code, notes, and snippets.

View rhughes42's full-sized avatar
🐧
Consultant, Founder & Fractional CTO

Ryan Hughes rhughes42

🐧
Consultant, Founder & Fractional CTO
View GitHub Profile

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
@rhughes42
rhughes42 / DotInteractionPInvokeDemo.cs
Created June 27, 2024 15:47
Custom Interaction & Auto-Closing Message Box Functionality
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows;
using Rhino;
using Rhino.DocObjects;
using Rhino.Geometry;
namespace GraphGeometry;
@rhughes42
rhughes42 / GrasshopperPlugin.csproj
Last active June 15, 2024 00:56
Template C# Grasshopper plugin for JetBrains Rider.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.5.24072.13001</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{073D9AA5-A4EE-4060-A478-9B076FC0B139}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
@rhughes42
rhughes42 / Polygon.md
Last active February 13, 2024 22:23
Optimizations to Polygon Class in Graph Geometry Package

Optimizations to Polygon Class in Graph Geometry Package

Motivation

Last week I started to put together a small geometry NuGet package featuring simple types and operations. The goal is to keep it lightweight and performant, even if it's written in C# as opposed to C++. The reason for keeping it in C# is that I may one day want to make the tools available in a more explicit format for uses in industries where programming proficiency is not so pervasive, hence opting for the more readable format.

Nonetheless, I need to optimize it where I can. This is the first in a series of gists on the matter.

1
In the RemoveVertices and RemoveVerticesAtIndex methods, it's better to remove items from the end of the list to the start. This is because removing an item from a list involves shifting all the subsequent items down. If you remove items from the start of the list first, you'll end up shifting the same items multiple times.

Code Before