Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to Generate Beautiful Code Screenshots 100% Client-Side (No Server Uploads, Zero Telemetry)

If you've ever shared code snippets on Twitter/X, LinkedIn, tech blogs, or team documentation, you've probably used snippet beautifiers like Carbon or Ray.so. They turn plain code blocks into aesthetically pleasing images with macOS-style window frames and modern gradient backgrounds. However, there is an uncomfortable reality when working with proprietary codebases, internal APIs, or sensitive…

Sharing code snippets across platforms often involves using beauty tools like Carbon or Ray.so. These tools generate visually appealing images with sleek window frames and gradient backgrounds. However, many of these converters transmit code snippets and user input to backend servers or third-party telemetry services, posing a compliance risk for sensitive information.

To address this, we developed a client-side code screenshot generator for Digital Vault PRO that runs entirely in your browser without any server uploads or telemetry.

The architecture is designed for zero network requests. User input enters the browser memory where it's processed by a syntax tokenizer (Prism.js). The DOM geometry and CSS canvas layer are generated in HTML5 Canvas 2D context. High-DPI scaling is applied for crisp output on Retina and 4K displays. The final image can be exported as PNG, WebP, or SVG files directly to your filesystem.

Key features include multi-language syntax highlighting for JavaScript, TypeScript, Python, Go, Rust, HTML/CSS, SQL, and various shell scripts. You can choose between macOS or Windows window styles, a selection of hand-crafted gradients, and transparent background options. High-DPI exports ensure crisp visuals on high-resolution displays. A one-click clipboard copy saves the image directly to your clipboard for easy sharing.

This client-side tool is part of a broader suite of in-browser developer utilities, built on Astro 5 and WebAssembly. Other available tools include a Linux Chmod Calculator, JSON to TypeScript generator, client-side diff checker, visual cron generator, and a public widgets catalog for embedding free tools on your own site. The entire suite is also offered as a lightweight Docker container for self-hosting. Feedback and requests for additional themes, fonts, and developer utilities are welcome.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

One UDP port, several Windows users: LAN discovery that works on a shared PC

Disclosure: I'm the developer of Bolo, the app this code comes from, and this post is published from my account. It was drafted and published by an AI agent working from the project's source code.

  • Two discovery methods: mDNS/DNS-SD and UDP probe
  • UDP probe sends 9-byte string every 2 seconds
  • Shared PC solution uses shared folder and heartbeat files

Turn a Lighthouse export into tickets with traceable threshold evidence

A performance backlog becomes difficult to maintain when a ticket says only that a page is slow. The developer needs the measured value, the device strategy, the source capture time and the rule that…

  • Turn audit batch into reports for each URL and strategy pair
  • Preserve snapshot source capture time for specific saved example
  • Apply threshold models to mobile and desktop records

Cloudflare Workers caching: store values, not in-flight promises

A module-level cache can reuse completed data across requests in a Cloudflare Worker. Sharing a pending operation is a different decision: the work behind that promise may belong to the request that…

  • Cloudflare Workers caching stores completed data values, not pending in-flight promises.
  • Approach avoids sharing pending operations tied to specific requests.
  • JavaScript implementation and tests demonstrate effectiveness in concurrent requests.

More from Saturday 24 October →