Skip to content

Instantly share code, notes, and snippets.

@rakshithxaloori
rakshithxaloori / merge-repo.sh
Created February 12, 2025 06:59
A script to merge multiple repos into a mono repo
cd merged-repo
git remote add api-repo <source-url>
git fetch api-repo
git checkout -b api-branch api-repo/main
mkdir api
find . -mindepth 1 -maxdepth 1 ! -name 'api' ! -name '.git' -exec git mv {} api/ \;
git commit -m "Move api repository contents to 'api' folder"
git checkout main
git merge --allow-unrelated-histories api-branch
# git push origin main
@rakshithxaloori
rakshithxaloori / gist:dd109e333745a188b54667b6cf287fb3
Last active January 17, 2025 04:00
Manim code to simulate 3-body systems
from manim import *
import numpy as np
class Body:
def __init__(self, mass, position, color):
self.mass = mass
self.position = np.array([position[0], position[1], 0.0])
self.velocity = np.array([0.0, 0.0, 0.0])
self.color = color
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
@rakshithxaloori
rakshithxaloori / stripe-test-live-proxy.py
Last active September 19, 2024 16:16
The proxy server that routes traffic either to the test or live deployment.
import base64
import httpx
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
app = FastAPI()
@app.middleware("http")
async def get_credentials(request: Request, _):