SShortSingh.
Back to feed

Developer replaces free hit counter API with Firebase after mobile blocking issues

0
·4 views

A developer building a static web app called Daily Doodle attempted to add a simple visitor hit counter using a free third-party API, countapi.mileshilliard.com. The counter worked correctly on desktop browsers but consistently failed to update on mobile devices, with no visible error shown to users. Investigation revealed the likely cause was the API's domain being blocked at the network level by ad blockers or mobile carrier filters. Switching to Firebase Realtime Database resolved the issue, as Google's infrastructure domain is rarely blocked by such filters. The developer shared a step-by-step setup using Firebase's REST API with server-side atomic increments, requiring no SDK or authentication under the free Spark plan.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How Vidstudio Streams and Caches Video in the Browser to Manage RAM

Vidstudio is a browser-based multi-track video editor that operates without any backend services, making efficient RAM management critical for its timeline feature. Because loading large video files entirely into memory risks crashing the system, the editor streams files instead, processing only the requested portion at a time. To reduce latency from repeated disk reads and decoding, Vidstudio maintains a cache of encoded video chunks, which are far smaller than decoded frames, and keeps a narrow window of decoded frames near the current playback position. When users scrub rapidly across the timeline, a debounce mechanism ensures only the most recent seek operation consumes device resources, cancelling earlier ones still in progress. Each of these design choices reflects a deliberate trade-off between conserving end-user resources and maintaining a responsive editing experience.

0
ProgrammingDEV Community ·

LeetCode 198 House Robber: Dynamic Programming Solution Explained

LeetCode problem 198, House Robber, challenges developers to find the maximum sum of non-adjacent elements in an integer array. The constraint is that no two consecutive houses can be robbed, simulating a security system that alerts police if adjacent homes are broken into on the same night. The solution uses dynamic programming, building a running array that tracks the maximum loot obtainable up to each house. At each step, the algorithm picks the greater value between robbing the current house plus the best result two steps back, or skipping the current house. Edge cases for arrays of size zero, one, and two are handled separately before the main loop executes.

0
ProgrammingDEV Community ·

Axelix Uses Java ScopedValues and Sealed Interfaces to Solve Real Production Problems

Mikhail Polivakha, technical lead of the open-source Axelix project, has detailed two practical uses of modern Java features in a real production codebase. The project uses ScopedValue — a newer alternative to ThreadLocal — to pass a security context token from an HTTP filter down to the transport layer without threading it through every method signature. Axelix also employs sealed interfaces not for pattern matching, but to enforce domain design constraints at the platform level rather than relying on informal developer agreements. Both examples demonstrate that newer Java features, introduced under the language's six-month release cycle, can address genuine architectural problems beyond interview questions or toy projects. The article aims to counter the common pattern where teams read about new JEPs but continue writing the same code they wrote years ago.

0
ProgrammingDEV Community ·

Free Web Tool Lets Users Compare Two Lists Instantly Without Code or Excel

A free web tool called Compare2Lists offers a quick way to find differences and similarities between two text-based lists, such as emails, URLs, or SKUs. Users simply paste their two lists into separate fields and click compare to see results instantly. The tool requires no sign-up, no coding knowledge, and no spreadsheet formulas. It is designed for practical use cases like comparing user email exports to identify new or missing entries. The tool is available at compare2lists.online and positions itself as a faster alternative to writing scripts or using Excel functions like VLOOKUP.