Dealing with minified XML from third-party APIs is painful. Most online tools are either bloated or can’t handle special nodes like CDATA and comme…
Posts for: #JavaScript
Word Counter: Unicode Handling and Regex Edge Cases in Mixed Chinese-English Text
Writing articles, tweets, documentation—you always need to count words. Many word counters exist, but when mixing Chinese and English, the results …
From Handshake to Heartbeat: Building a WebSocket Online Testing Tool
Recently, I was developing a real-time chat feature with WebSocket on the backend. Debugging was painful—browser DevTools’ Network panel shows WebS…
Browser-Based Web Screenshots: From getDisplayMedia API to Canvas Implementation
I recently built a web screenshot tool, thinking it’d be straightforward. Spoiler: I hit several gotchas. Here’s what I learned, in case you’re tac…
UUID Generator Algorithms: From v1 to v4 Implementation
Building a distributed system recently, I needed globally unique IDs. Started with auto-increment database IDs, then hit a wall with sharding—diffe…
URL Encoding Decoded: From Percent Signs to encodeURIComponent
Last week, I was debugging a payment callback where URL parameters were double-encoded, causing order ID parsing failures. It turned out many devel…
Unit Converter: From Floating-Point Precision to Temperature Offsets
I recently needed to convert between inches and centimeters for a project. Wrote a quick formula, but the result didn’t match the design specs—that…
How LLM Token Counting Works: Building a Client-Side Token Estimator
Every time you call a GPT or Claude API, you’re paying by the token. But what exactly is a token, and how do you estimate token counts without load…
JavaScript Timezone Conversion: From Unix Timestamps to IANA Identifiers
Recently built a cross-timezone meeting scheduler and stepped into quite a few timezone pitfalls. Let me share what I learned about JavaScript time…
Unix Timestamp Pitfalls: A Complete Guide to Timestamp Conversion
Last week, I was debugging a production issue. The logs were filled with numbers like 1745678901. Our new intern looked confused: “What are these…