This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Prompt: Fix yourjavaguy.me | |
| Copy everything below into Claude Code (or similar) from the site's repo root. | |
| --- | |
| You are acting as a senior frontend engineer and a senior product designer doing a refinement pass on my personal site (yourjavaguy.me — static HTML/CSS/JS, Newsreader serif + JetBrains Mono, dark navy palette). The site's identity is good. Your job is to fix bugs, tighten craft, and improve performance — **not** to redesign it. Work through the priorities in order. Commit per priority level with clear messages. | |
| ## P0 — Bugs (things visibly broken) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RingBuffer { | |
| constructor(capacity) { | |
| this.capacity = capacity; | |
| this.buffer = new Array(capacity); | |
| this.head = 0; // Read pointer | |
| this.tail = 0; // Write pointer | |
| this.count = 0; // Current number of elements | |
| } | |
| // Add an element to the buffer (overwrites oldest if full) | |
| enqueue(item) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title></title> | |
| </head> | |
| <body style="margin: 0;"> | |
| <style> | |
| @media only screen and (max-width: 600px) { | |
| .main-table { | |
| width: 100% !important; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| useEffect(() => { | |
| console.log({ url: process.env.REACT_APP_SOCKET_ENDPOINT }); | |
| function onConnect() { | |
| console.log("Socket connected successfully"); | |
| setIsConnected(true); | |
| console.log(personId); // Check if personId is logged correctly | |
| socket.emit("join", { person_id: personId }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Custom hook for mutations | |
| const useCustomMutation = <T = unknown>( | |
| mutationFn: (...args: any[]) => Promise<T>, | |
| options?: UseMutationOptions<T, unknown, unknown> | |
| ) => { | |
| return useMutation(mutationFn, { | |
| onSuccess: (data) => { | |
| // Handle success case | |
| console.log('Mutation successful:', data); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function countRectangles(board) { | |
| let count = 0; | |
| let N = board.length; | |
| let M = board[0].length; | |
| for (let r = 0; r < N; r++) { | |
| for (let c = 0; c < M; c++) { | |
| for (let i = r; i < N; i++) { | |
| for (let j = c; j < M; j++) { | |
| let aCount = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function combineCustomNights(customNights) { | |
| const result = []; | |
| let currentRange = null; | |
| customNights.sort((a, b) => new Date(a.date) - new Date(b.date)); | |
| customNights.forEach((night) => { | |
| if (!currentRange) { | |
| currentRange = { start: night.date, end: night.date, rooms: { ...night } }; | |
| delete currentRange.rooms.date; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function belongsToTriangle(x1, y1, x2, y2, x3, y3, xp, yp, xq, yq) { | |
| // Calculate the length of the sides of the triangle | |
| const lab = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); | |
| const lac = Math.sqrt((x3 - x1) ** 2 + (y3 - y1) ** 2); | |
| const lbc = Math.sqrt((x3 - x2) ** 2 + (y3 - y2) ** 2); | |
| // Check if the triangle is non-degenerate | |
| if (lab + lac <= lbc || lab + lbc <= lac || lac + lbc <= lab) { | |
| return "o"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function palindromeChecker(s, startindex, endindex, subs) { | |
| let result = ''; | |
| for (let i = 0; i < startindex.length; i++) { | |
| let sub = s.substring(startindex[i], endindex[i] + 1); | |
| let count = new Array(26).fill(0); | |
| for (let j = 0; j < sub.length; j++) { | |
| count[sub.charCodeAt(j) - 97]++; | |
| } | |
| let oddCount = 0; | |
| for (let j = 0; j < 26; j++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function makePalindrome(s, startindex, endindex, subs) { | |
| let result = ""; | |
| for (let i = 0; i < startindex.length; i++) { | |
| let substring = s.substring(startindex[i], endindex[i] + 1); | |
| let count = 0; | |
| let charMap = new Map(); | |
| for (let j = 0; j < substring.length; j++) { | |
| charMap.set(substring.charAt(j), charMap.get(substring.charAt(j)) + 1 || 1); | |
| } | |
| for (let [char, freq] of charMap) { |
NewerOlder