Skip to content

Instantly share code, notes, and snippets.

@mikebuss
mikebuss / grid.tsx
Created June 9, 2025 16:11
Grid in React-Three-Fiber
const Grid = ({ number = 10, lineWidth = 0.026, height = 0.1 }) => {
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
return (
// Renders a grid and crosses as instances
<Instances position={[0, -3.02, 0]}>
<planeGeometry args={[lineWidth, height]} />
<meshBasicMaterial color="#999" />
{Array.from({ length: number }, (_, y) =>
Array.from({ length: number }, (_, x) => (
<group key={x + ':' + y} position={[x * 2 - Math.floor(number / 2) * 2, -0.01, y * 2 - Math.floor(number / 2) * 2]}>
- After making changes, ALWAYS make sure to start up a new server so I can test it.
- Always look for existing code to iterate on instead of creating new code.
- Do not drastically change the patterns before trying to iterate on existing patterns.
- Always kill all existing related servers that may have been created in previous testing before trying to start a new server.
- Always prefer simple solutions
- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality
- Write code that takes into account the different environments: dev, test, and prod
- You are careful to only make changes that are requested or you are confident are well understood and related to the change being requested
- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we d

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
from manim import *
import numpy as np
class DualRingHeatTransferAnimation(Scene):
def construct(self):
# Configuration
num_blocks = 20
num_around = 39
block_size = 0.4
outer_radius = 3.3
import geopandas as gpd
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.colors as mcolors
from shapely.geometry import Polygon, MultiPolygon
import shapely.ops
import os.path
def get_text_color(fill_color):
@ruvnet
ruvnet / notebook.ipynb
Last active January 31, 2025 23:08
5cdbbd43ab3a0c728fdd3e7a2a8aedd9
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

File Summarization API

This FastAPI application provides an API endpoint for uploading files and generating summaries using LlamaIndex. It supports a wide variety of file types including documents, images, audio, and video files.

Features

  • File upload endpoint
  • Automatic file type detection
  • Document summarization using LlamaIndex
  • Support for multiple file types (PDF, Word, PowerPoint, images, audio, video, etc.)
import time
from datetime import timedelta
from datasets import load_dataset
from txtai import LLM
from txtai.pipeline import Labels, HFTrainer
def prompt(text):
text = f"""
import instructor
from pydantic import BaseModel, Field
from typing import overload, Union, Literal, Generator
from tqdm.asyncio import tqdm
import asyncio
import numpy as np
import json
import os, sys
import diskcache, inspect, functools
import random
@ruvnet
ruvnet / APM.md
Last active January 31, 2025 23:05
Agent Package Management

Introduction: Agent Algorithm Repository

In the rapidly evolving field of artificial intelligence, the need for a comprehensive and structured repository for algorithms designed for intelligent agents has become increasingly important.

The Agent Algorithm Repository aims to address this need by providing a centralized platform for discovering, sharing, and utilizing a wide range of algorithms. This repository is designed to be language-agnostic, ensuring compatibility with various programming languages and promoting a standardized approach to algorithm description, documentation, and distribution.

The repository facilitates the following key objectives:

  1. Language Agnosticism: By supporting algorithms implemented in any programming language, the repository ensures broad applicability and ease of integration across different technology stacks.