SShortSingh.

Programming

0
ProgrammingDEV Community ·

Developer Documents Three Undisclosed Solana Failures When Implementing x402 Payments

A developer building a paid API using the x402 protocol on Solana mainnet encountered three critical failures not covered in official documentation. The first issue was that a fresh payout wallet lacking an Associated Token Account (ATA) caused every transaction to fail simulation before any money moved. The second problem arose in serverless environments like Cloudflare Workers, where multiple isolates independently fetched and cached a rotating fee-payer key from Coinbase's CDP facilitator, causing verification mismatches. Each failure had a discrete fix: pre-funding the payout ATA at deployment and pinning a single shared facilitator snapshot in KV storage to ensure all isolates use the same fee-payer. The writeup highlights how Solana's stateful token account model and distributed-cache behaviour create payment-flow pitfalls that EVM-based x402 implementations do not face.

0
ProgrammingDEV Community ·

How to Calculate the Day-of-Year Number in JavaScript

A beginner-friendly JavaScript technique allows developers to find the numerical day-of-year for any given date. The method works by subtracting January 1st of the target year from the chosen date to get a millisecond difference. That difference is then divided by the number of milliseconds in a day to produce a whole number result. For example, January 1st returns day 1, while February 1st correctly returns day 32. The approach requires no external libraries and relies entirely on native JavaScript date arithmetic.

0
ProgrammingDEV Community ·

How Chat Templates Actually Work in Supervised Fine-Tuning

When fine-tuning language models, the structured 'messages' list used in Python never reaches the model — only the rendered text string does. Chat templates are Jinja2 programs stored in tokenizer configuration files that flatten conversation structure into a single token sequence. Roles like 'user' and 'assistant' are represented as actual vocabulary tokens, not metadata fields, meaning the model learns turn-taking purely from token patterns. A key distinction exists between training, which renders the full conversation, and inference, which appends a generation prompt — and both must produce identical prefixes to avoid mismatches. Common pitfalls include accidentally adding duplicate special tokens and overlooking how whitespace stripping in Jinja2 tags directly affects the final token sequence.

0
ProgrammingDEV Community ·

How One Dev Team Uses Only 10% of TanStack Table v8 to Power 50+ Tables

A developer building a retail POS platform shared how their team handles over fifty distinct table screens — covering merchants, inventory, transactions, and more — using TanStack Table v8 in Next.js. Rather than using the library's built-in sorting, filtering, and pagination models, the team delegates all those operations to the server via API query parameters. All tables across the platform render through a single reusable DataTable component that only calls getCoreRowModel(), keeping the client-side logic minimal. Custom columns are handled with an id and cell renderer reading from row.original, while columns needing router or query access are wrapped in small custom hooks. The approach significantly reduces repetition, with new table screens requiring only a column definition file and a data-fetching hook.

0
ProgrammingDEV Community ·

Why AI-Vibe-Coded Apps Eventually Need Real Programming Discipline

A commentary by software consultant Gil Zilberfeld argues that while AI-assisted 'vibe coding' is useful for building prototypes quickly, it falls short when maintaining or scaling a production application. As codebases grow, AI-generated code tends to accumulate bugs, performance issues, and technical debt because the underlying code quality mirrors the average quality of data the models were trained on. Zilberfeld recommends that developers transitioning from prompt-driven development first audit their existing codebase, consolidate scattered prompts, and have AI agents generate documentation — while carefully distinguishing what the code does from what it was intended to do. He also advises generating tests based on original intent rather than current buggy behavior, to avoid enshrining mistakes as requirements. Ultimately, he contends that understanding clean code principles remains essential, even when AI agents are doing much of the writing.

0
ProgrammingDEV Community ·

AI-Generated Code Is Creating a Larger, Harder-to-Track Form of Technical Debt

AI code debt refers to the accumulation of generated code left unimproved, mirroring traditional technical debt but at a far greater scale. Because much of this code is never fully reviewed by developers, the gap between current and ideal code quality is significantly wider than with hand-written code. Coding agents also lack the context of future development plans, meaning they introduce assumptions that can complicate later changes. Experts recommend enforcing smaller, incremental code generation to make review more manageable, and relying on tests to catch errors during refactoring. Unlike traditional technical debt — which developers at least knew they had created — AI code debt can accumulate invisibly, making it harder to locate and costlier to address.

0
ProgrammingDEV Community ·

Cloudflare Proxy Alone Won't Protect Your Origin Server, Here's What Will

Simply enabling Cloudflare's DNS proxy does not shield an origin server if attackers discover its real IP through DNS history tools, certificate transparency logs, or subdomain scanning. A comprehensive hardening approach requires three layers: restricting server firewall rules to accept traffic only from Cloudflare's published IP ranges, enabling Authenticated Origin Pulls so the origin verifies requests carry a Cloudflare-signed client certificate, and setting SSL/TLS mode to Full (strict) with a valid Cloudflare Origin CA certificate. Management ports such as SSH and database access must be locked separately to a VPN or bastion host, as Cloudflare does not proxy these connections. Each control should be independently verified — for example, running a direct curl request to the origin IP to confirm outside traffic is blocked — rather than assumed active after toggling a setting.

0
ProgrammingDEV Community ·

AI agent flags $1,411 in bad invoices, but hard-coded rules did the real work

A developer tested an AI-assisted invoice review system by feeding it 13 invoices, three of which were deliberately flawed — a padded total, an unauthorized purchase, and a duplicate. The system correctly blocked all three problematic invoices, totalling $1,411.25, while approving the remaining ten worth $9,049.05. The workflow used a vision model to convert invoice images into structured JSON data, while a separate code node applied three strict rules: matching purchase orders, exact amount verification, and checking for duplicate invoice numbers. The entire process cost roughly one cent per image and completed in 28 seconds, but the developer stressed that the AI only extracted data — all financial decisions were made by deterministic code. The experiment also exposed a key limitation: the vision model misread an ambiguous date with full confidence, highlighting that AI-extracted values should never directly drive consequential financial logic.

0
ProgrammingDEV Community ·

Developer Builds Telegram-to-Discord Signal Bot in 6.5 Hours Using No-Code-First Approach

A developer built a functional bot that monitors a Telegram channel for token mentions and forwards top signals to a private Discord server, completing the project in 6.5 hours over a weekend. The approach prioritized prototyping with Zapier's free tier first to validate the core workflow before writing any Python code. Initial no-code testing across 300 messages revealed a 21% false-negative rate in signal detection, which justified moving to Python for more complex filtering logic. The author argues that most personal automation projects fail because developers over-engineer the first version instead of testing a single core workflow quickly. The recommended method is to use no-code tools to prove a concept within two hours, then migrate only the logic-heavy components to code when no-code tools hit their limits.

0
ProgrammingDEV Community ·

How a CSS dice roller determines its result before the animation even begins

A developer building a browser-based dice-rolling page discovered a key design insight while implementing a pure CSS tumbling animation: the random number is generated first, and the rotation angle is then calculated to match that predetermined result. Each face of the 3D cube is constructed using absolutely-positioned elements pushed outward with translateZ and oriented with rotateX or rotateY, held together via transform-style: preserve-3d. Extra full 360-degree spins are added on top of the target angle purely for visual effect, since they cancel out mathematically and do not affect the final resting face. This approach ensures the visible face and the recorded result are always in sync, eliminating a common bug where a dice animation lands on one number while the score quietly logs another. The cube is also snapped back to zero degrees before each new roll, so every animation starts from a clean resting position rather than continuing from a previous rotation.

0
ProgrammingDEV Community ·

X-Forwarded-For misconfiguration can silently break your app's rate limiter

When an application runs behind a reverse proxy or tunnel, incoming TCP connections appear to originate from the relay server rather than the real client. This causes rate limiters to throttle the proxy instead of individual users, meaning one bad actor can block all traffic or bad actors can bypass limits entirely. Proxies typically pass the original client IP via the X-Forwarded-For header, but blindly trusting this header allows clients to spoof any IP address. The correct fix is to configure a trusted proxy list in your framework so that forwarded headers are only accepted from relay servers you control. As tunnels become standard for webhook testing and local development, choosing tools that correctly set and document forwarded headers is increasingly important for application security.

0
ProgrammingDEV Community ·

How to Build Cost Forecasting Into AI Agent Workflows Before They Run

Developers building AI agent products often discover costs only after a workflow completes, leaving no chance to warn users or prevent overspending. Unlike simple API calls, agent workflows branch across multiple steps — including retrieval, tool calls, retries, and validation — each adding tokens and cost unpredictably. A proposed forecasting framework treats every agent run like a job with a cost contract, cycling through quote, reserve, run, and reconcile phases. Before execution, the system estimates a cost range covering likely, low, and high scenarios, then reserves budget and enforces limits during the run. This approach allows products to route, cap, queue, or seek approval for expensive workflows before spend damages pricing, margins, or user trust.

0
ProgrammingDEV Community ·

Developer Builds Contextual Permission Engine to Govern AI Agent Tool Calls

A developer released Agent ToolTrust, an open-source permission engine designed to intercept and evaluate AI agent tool calls before they execute. The tool runs each call through a five-stage pipeline — normalize, score, decide, explain, and audit — returning one of four decisions: allow, audit, escalate, or deny. The project was motivated by repeated failures where unit tests and mock agents masked real integration problems in production environments. The developer validated the release by testing 83 real agents across 10 frameworks, achieving 2,490 passing tests before publishing to PyPI. The tool addresses a widely reported gap: roughly 80% of organizations report AI agents have taken actions beyond their intended scope, while only about 18% of MCP server deployments implement any access scoping.

0
ProgrammingDEV Community ·

Developer Builds Open-Source Tool ArtifactSweep to Reclaim Disk Space from Build Folders

A developer created ArtifactSweep, a free open-source utility designed to help programmers identify and delete auto-generated folders like node_modules, dist, and framework caches that accumulate across project directories. The tool was born out of frustration with manually hunting down these folders every few months to recover disk space. ArtifactSweep offers both a command-line interface called 'sweep' and a desktop GUI, supporting Windows, Linux, and macOS. In one test, the tool recovered nearly 5 GB from a single project directory. Released under the MIT license, the tool is available for download and welcomes community feedback via GitHub.

0
ProgrammingDEV Community ·

Developer builds reusable AI-powered resume system while racing a recruiter deadline

A software developer received a recruiter outreach from Riot Games while preparing to re-enter the job market, leaving only a couple of afternoons to produce a resume. Rather than using an off-the-shelf resume builder, he used Cursor to build a structured career system that separates stable career facts stored in YAML from application-specific rendered output. The system allowed him to select and rephrase relevant experience for each role, such as surfacing a game-design award specifically for the Riot Games application. Within a week, the same career inventory was reused for a second application at an AI product company, with a different evidence slice selected for that context. What began as a single-deadline workaround evolved into a broader tool covering interview prep, driven by AI lowering the cost of iteration enough to make custom software worthwhile.

0
ProgrammingDEV Community ·

Developer Launches HackForPinas, a Free Open-Source Directory for Philippine Hackathons

A Filipino developer has built HackForPinas, a free and open-source platform designed to centralise the discovery of hackathons and coding competitions across the Philippines. The project was born out of frustration with events being scattered across university, government, corporate, and community websites. The platform aggregates data using multiple web-scraping strategies to pull information from varied sources into a single consistent dataset. To prevent spam and misinformation, community submissions go through an admin moderation workflow before being listed publicly. The application also incorporates security measures such as schema validation and maintains an audit log of all moderation activity.

0
ProgrammingDEV Community ·

Ten CLI Tools That Can Replace Postman for API Testing in 2026

A developer writing for DEV Community outlines why CLI-based API testing tools have become a practical alternative to Postman for terminal-driven workflows. The shift was driven by the need to integrate API testing into scripts, Docker containers, and CI/CD pipelines without relying on a graphical application. CLI tools offer advantages such as version-controlling test files in Git, running tests automatically during pull requests or deployments, and compatibility with remote or cloud development environments. AI coding agents like Claude Code can also execute CLI commands directly, enabling automated test-run-fix cycles without manual GUI interaction. The article surveys ten command-line tools ranging from simple HTTP clients like curl to full-featured testing frameworks that support collections, environments, and lifecycle management.

0
ProgrammingDEV Community ·

Developer Builds Spider-Man-Themed Portfolio Site Inspired by Peter Parker's Curiosity

A software developer has launched a personal portfolio website called 'Peter Parker's Lab', designed to reflect the spirit of the fictional character rather than follow conventional portfolio templates. The developer drew inspiration from Peter Parker's identity as a curious, experimental builder rather than from Spider-Man's superhero persona. The site serves as a digital lab showcasing ongoing work in areas such as AI, automation, full-stack development, cloud infrastructure, and DevOps. Rather than presenting a static list of skills or repositories, the portfolio is intended to highlight the problems the developer is curious about and the projects they are actively building. The site, hosted at peterparker-lab.vercel.app, is described as version one, with updates planned as the developer's work and interests evolve.

0
ProgrammingDEV Community ·

CSS :has() selector eliminates JavaScript for common form interactions

The CSS :has() pseudo-class, now supported across Chrome, Edge, Firefox, Safari, and Opera without polyfills, allows developers to style a parent element based on conditions inside its child elements. Previously, tasks like highlighting a focused field, showing validation errors, or marking required inputs demanded JavaScript event listeners and class toggling. With :has(), a single CSS selector can replace multiple lines of JS — for example, styling a wrapper when its input receives focus or when it contains an invalid value. Pairing :has() with states like :invalid and :not(:placeholder-shown) enables real-time inline validation that only triggers after user interaction, avoiding premature error messages on page load. While :has() handles most visual state changes natively, developers are advised to remain cautious around accessibility concerns, such as using pointer-events: none alone to disable form submission buttons.

0
ProgrammingDEV Community ·

How UPI Handles Millions of Simultaneous Payments Without Crashing

India's Unified Payments Interface faces extreme traffic spikes on salary days, when simultaneous transactions can surge from roughly 100,000 to over one million requests per second. Rather than relying on a single powerful server, UPI-style systems distribute traffic across many machines using load balancers and horizontal scaling, so that no single point of failure can bring down the entire network. However, scaling the application layer alone is insufficient, as concurrent requests accessing the same bank account can trigger race conditions that allow more money to be spent than actually exists. Solving this requires additional techniques such as database-level concurrency controls, idempotency, and distributed consistency mechanisms. Together, these challenges make large-scale payment systems one of the most complex problems in distributed systems design.

← NewerPage 169 of 1336Older →