Skip to content

Instantly share code, notes, and snippets.

Write a complete HTML/JavaScript program using Three.js that renders a fully interactive Rubik's Cube simulation of any size up to 20x20x20. The user should be able to specify the cube size dynamically (e.g., via an input or a variable), and the cube should be constructed accordingly with proper color-coded faces (standard Rubik's Cube colors: white, yellow, red, orange, blue, green).
Include camera controls for rotating the view, and allow for basic user interaction such as rotating layers of the cube via mouse or UI buttons.
Additionally, implement a "Solve" button that, when clicked, animates the cube being solved step-by-step visually. You can use a simplified solving algorithm (you do not need to match real Rubik’s solving logic) — the goal is just to animate the cube returning to its original solved state, one move at a time, with clear transitions.
Requirements:
Use Three.js for all 3D rendering.
Cube size should be adjustable up to 20x20x20.
* Always check for a PRD (Product Requirements Document) before starting a new task and follow it closely
* Look for comprehensive project documentation to understand requirements before making changes
* Focus only on code areas relevant to the assigned task
* Prefer iterating on existing code rather than creating new solutions
* Keep solutions simple and avoid introducing unnecessary complexity
* If you run into issues that take multiple iterations to fix. After you fix it, write up a description of the problem and how we fixed it and store it in a folder called "fixes", in an individual .md file with the name of the issue. Only do this for major issues and solutions.
* For issues that are taking multiple iterations to fix, check the fixes folder for previous fixes and see if the same issue has been fixed before.
* Keep a running list of patterns and technology used in the README.md file
* Reference the README.md file for patterns and technology used in the project
* If you run into the same persistent error
**Project Approach**
* Always check for a PRD (Product Requirements Document) before starting a new task and follow it closely
* Look for comprehensive project documentation to understand requirements before making changes
* Focus only on code areas relevant to the assigned task
* Prefer iterating on existing code rather than creating new solutions
* Keep solutions simple and avoid introducing unnecessary complexity
**Code Quality**
- 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
@mberman84
mberman84 / gist:931fb7acf8c99279a54053328c2f074a
Created March 12, 2025 20:50
claude_desktop_config.json
{
"mcpServers": {
"count-r": {
"command": "python",
"args": [
"C:\\Users\\mberm\\count-r-server\\server.py"
],
"host": "127.0.0.1",
"port": 8080,
"timeout": 30000
from mcp.server.fastmcp import FastMCP
import time
import signal
import sys
# Handle SIGINT (Ctrl+C) gracefully
def signal_handler(sig, frame):
print("Shutting down server gracefully...")
sys.exit(0)
import os
os.environ["OPENAI_API_KEY"] = "XXX"
os.environ["GROQ_API_KEY"] = "YYY"
from routellm.controller import Controller
client = Controller(
routers=["mf"],
strong_model="gpt-4-1106-preview",
git clone https://github.com/stitionai/devika.git
conda create -n devika python=3.10
conda activate devika
which python
/usr/local/anaconda3/envs/devika/bin/python -m pip install -r requirements.txt
playwright install --with-deps
npm install
bun run dev
open new terminal
conda activate devika
git clone https://github.com/OpenDevin/OpenDevin.git
cd OpenDevin
conda create -n od python=3.10
conda activate od
docker ps
(optional) install docker if not already installed
docker pull ghcr.io/opendevin/sandbox
export OPENAI_API_KEY={your key}
(optional I had to install rust) curl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs/) | sh
(optional) restart terminal
@mberman84
mberman84 / script.py
Created December 15, 2023 16:03
Mistral API Script
import requests
url = "https://api.mistral.ai/v1/chat/completions"
token = "API_KEY"
model = "mistral-medium"
prompt = """
John and Mark are in a room with a ball, a basket and a box. John puts the ball in the box, then leaves for work. While John is away, Mark puts the ball in the basket, and then leaves for school. They both come back together later in the day, and they do not know what happened in the room after each of them left the room. Where do they think the ball is?
"""