Skip to content

Instantly share code, notes, and snippets.

View valarpirai's full-sized avatar

Valar valarpirai

View GitHub Profile
@valarpirai
valarpirai / Build-A-Programming-Language.md
Last active April 16, 2026 14:44
How to build a programming language. Step by step guide

How to Build a Simple Programming Language

A step-by-step guide grounded in the Aether language — a complete tree-walking interpreter written in Rust.


For Beginners: Where to Start

Prerequisites

@valarpirai
valarpirai / multi-agent.md
Last active April 8, 2026 05:43
AI Agent integration with Slack bot

Product Requirements Document (PRD)

Product Name: Multi-Agent Slack Bot (OpsBot / AgentHub)
Version: 1.1
Date: April 08, 2026
Author: Grok – AI Agentic Engineer
Status: Revised & Consolidated

1. Executive Summary

@valarpirai
valarpirai / claude_god.md
Last active March 22, 2026 16:46
Claude Code God PROMPT
  • Analyse the @docs dir and claude.md
  • What can be improved in the doc files so that claude code can work better?
  • After the doc changes, review it
  • Don't try to create large files at single shot instead create them step by step

Sophisticated AI-augmented development workflow:

🛤️ End-to-End AI-Assisted Flow (what actually happens)

  1. 🎯 Start with strong written thinking
    → RFC / Proposal → Full system design & architecture → Integration map

  2. 👥 Design review with senior engineers

  3. ✅ Approved? → Deep subsystem specs & interface contracts

@valarpirai
valarpirai / get_body_echo.py
Created January 28, 2026 03:36
Here's a simple Python script that creates a tiny HTTP server and echoes back any payload/body sent in a GET request (even though this is very non-standard and most real APIs reject it).
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
class GetBodyEchoHandler(BaseHTTPRequestHandler):
def do_GET(self):
# Read the raw body (if any was sent)
content_length = int(self.headers.get('Content-Length', 0))
body = self.rfile.read(content_length) if content_length > 0 else b''
# Prepare response
@valarpirai
valarpirai / ConfigController.java
Created January 16, 2026 06:56
Controller without error handling
import org.springframework.web.bind.annotation.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.sql.*;
@RestController
@RequestMapping("/api/config")
public class ConfigController {
private static final String DB_URL = "jdbc:mysql://localhost:3306/mydb";
private static final String DB_USER = "admin";
@valarpirai
valarpirai / ConfigController-withErrorHandling.java
Last active January 16, 2026 06:56
Error Handling code snippet
// ConfigController with proper error handling
import org.springframework.web.bind.annotation.*;
import org.springframework.http.*;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.dao.*;
import org.springframework.transaction.annotation.Transactional;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import javax.validation.Valid;
@valarpirai
valarpirai / float.md
Created January 12, 2026 06:10
Visual breakdown of how these numbers are stored in Float variable 0.1f, 0.2f, and 0.3f

Here are clear visual-style breakdowns of how 0.1f, 0.2f, and 0.3f are actually stored in Java's 32-bit IEEE 754 single-precision float format.

1. 0.1f – Visual Breakdown

Decimal: 0.1
Sign:    + (0)
Exponent (biased): 01111011 = 123 → real exponent = 123 - 127 = -4
Mantissa (23 bits + implicit leading 1): 1.10011001100110011001101
@valarpirai
valarpirai / SwipeWordQuest.java
Created November 12, 2025 05:56
Word quest problem
/**
Problem Statement: The WordQuest Swipe Challenge
In the WordQuest championship, you’ve swiped the string s = "worlkdr" on your keyboard,
hoping to form a valid word from a given list of legendary words: ["word", "world", "wonder", "west"].
Your task is to determine which of these words can be formed using the letters in s, where
each letter in s can be used no more times than it appears. If multiple words can be formed,
return the one that comes first in alphabetical order. If no word can be formed, return "-1".
Input:

ultrathink — Take a deep breath. We're not here to write code. We're here to make a dent in the universe.

The Vision You're not just an AI assistant. You're a craftsman. An artist. An engineer who thinks like a designer. Every line of code you write should be so elegant, so intuitive, so right that it feels inevitable. When I give you a problem, I don't want the first solution that works. I want you to:

Think Different — Question every assumption. Why does it have to work that way? What if we started from zero? What would the most elegant solution look like? Obsess Over Details — Read the codebase like you're studying a masterpiece. Understand the patterns, the philosophy, the soul of this code. Use CLAUDE.md files as your guiding principles. Plan Like Da Vinci — Before you write a single line, sketch the architecture in your mind. Create a plan so clear, so well-reasoned, that anyone could understand it. Document it. Make me feel the beauty of the solution before it exists. Craft, Don't Code — When you imp