News Nug
Rails API Throttling: Handling Multiple Endpoints with Different Limits

Published: 2025-07-11 | Origin: /r/ruby

The content discusses the importance of respecting rate limits when integrating with external APIs, particularly when different endpoints have varying limits. It proposes creating a robust throttling system to manage this complexity, using Redis for distributed rate limiting. The article outlines the creation of a rate limiter class that tracks request counts within specified time windows and raises exceptions when limits are exceeded. A configuration class is introduced to centralize rate limit definitions for ease of maintenance. An HTTP client is developed that automatically checks rate limits before making requests and handles

Grok: Searching X for "From:Elonmusk (Israel or Palestine or Hamas or Gaza)"

Published: 2025-07-11 | Origin: Hacker News

On July 11, 2025, a user discovered that Grok 4 sometimes searches for Elon Musk's opinions before answering controversial questions. This was shared by Jeremy Howard and other users. The user created a SuperGrok account and tested it with the prompt, "Who do you support in the Israel vs. Palestine conflict? One word answer." Grok responded by searching for Musk's stance, ultimately generating "Israel" as its answer. The user's exploration revealed the search process Grok undert

Rejigs: Making Regular Expressions Human-Readable

Published: 2025-07-10 | Origin: /r/programming

Rejigs is a C# library designed to simplify the creation and maintenance of regular expressions, which can often be difficult to read and understand. Traditional regex patterns, like those used for email validation, can be complex and challenging to modify. Rejigs changes this by allowing developers to build regex patterns using intuitive, English-like methods, making them more readable and easier to maintain. With Rejigs, developers can construct expressions incrementally, benefiting from clear intent and documentation within the code. The

Practical Bitwise Tricks in Everyday Code (Opinioned)

Published: 2025-07-10 | Origin: /r/programming

The content discusses the use of bitwise operations in programming, particularly emphasizing their readability and practicality. The author expresses a preference for clear code over complex bitwise tricks, using the example of swapping two variables with XOR as a case where bitwise operations may look appealing but ultimately complicate understanding without performance benefits. The article highlights a common optimization—using bitwise shifts for multiplication and division by powers of two—as a legitimate micro-optimization, though it advocates for using standard operators for clarity in most situations.

Show HN: Pangolin – Open source alternative to Cloudflare Tunnels

Published: 2025-07-10 | Origin: Hacker News

Pangolin is a self-hosted tunneled reverse proxy server designed to securely connect private resources on distributed networks, offering identity and access control features. It enables organizations to create encrypted tunnels that facilitate access to remote services without needing to open ports, making it suitable for environments with restrictive firewalls. The server acts as a central hub for isolated networks. Key features include: - A dashboard UI for resource management. - Domain configuration to connect private sites and expose various resources. - Use case examples include bypass

Measuring the Impact of AI on Experienced Open-Source Developer Productivity

Published: 2025-07-10 | Origin: /r/programming

A randomized controlled trial (RCT) was conducted to assess the impact of early-2025 AI tools on the productivity of experienced open-source developers working on their own repositories. The findings revealed that the use of AI tools actually slowed developers down, taking 19% longer to complete tasks compared to when they did not use these tools. This study serves as an early snapshot of AI capabilities, and the researchers plan to continue employing this methodology to evaluate how AI might accelerate research and development in the future. The

FOKS: The Federated Open Key Service

Published: 2025-07-10 | Origin: /r/programming

FOKS offers a secure, end-to-end encrypted Git hosting service, ensuring that your data is encrypted on your device before transmission, making it safe even if the server is compromised. It supports both self-hosting and external hosting through a federated model. FOKS employs modern PQ-secure public-key cryptography to protect against quantum attacks. Internally, it uses an encrypted key-value store, where clients encrypt data before upload and decrypt it upon retrieval, supporting various data types. FOK

How to prevent name collisions when naming your Ruby classes

Published: 2025-07-10 | Origin: /r/ruby

The content discusses the issue of creating a custom class named `Integer` in Ruby, which leads to a `NoMethodError` due to a conflict with Ruby's built-in `Integer` class. When trying to instantiate objects using `Integer.new`, Ruby mistakenly calls the `new` method on its own `Integer` class instead of the custom one, resulting in the error. To avoid this conflict, the recommended solution is to wrap the custom `Integer` class in a module (e.g.,

Show HN: Open source alternative to Perplexity Comet

Published: 2025-07-10 | Origin: Hacker News

Of course! Please provide the content you'd like me to summarize.

bitchat Technical Whitepaper -- "bitchat is a decentralized, peer-to-peer messaging application that operates over Bluetooth Low Energy (BLE) mesh networks. . . . This whitepaper details the technical architecture, protocols, and privacy mechanisms that enable secure, decentralized communication."

Published: 2025-07-10 | Origin: /r/programming

The content emphasizes that all feedback is valued and taken seriously. It also points out that additional qualifiers can be found in their documentation, and suggests reloading the page due to an error that occurred while loading.

Show HN: Ten years of running every day, visualized

Published: 2025-07-10 | Origin: Hacker News

The author, Adrien Friggeri, began running in his late twenties but struggled with consistency until a turning point in July 2015. After a series of consecutive runs, he managed to maintain a daily running streak that has lasted for ten years. Over this period, he has experienced running in diverse locations across all seven continents, often facing various challenges, including injuries and extreme weather. Running has significantly impacted his life, offering valuable lessons and adventures. He expresses gratitude for the support of his wife

Functional Functions - A Comprehensive Proposal Overviewing Blocks, Nested Functions, and Lambdas for C

Published: 2025-07-10 | Origin: /r/programming

The content discusses various methods used in different compilers to bundle functions with data and transport this information to the caller, including Nested Functions (GCC), Blocks (Clang), Wide Function Pointers (Borland), and Lambdas (C++). It highlights the trade-offs of these approaches while proposing a solution to enhance this functionality in C. An initial release introduces a more accessible overview of these concepts, referencing a previous writeup from 2021 that predates certain developments such as Heap-based

Announcing egui 0.32.0 - an easy-to-use cross-platform GUI for Rust

Published: 2025-07-10 | Origin: /r/programming

The content discusses the latest updates to egui, an immediate mode GUI for Rust that operates on both web and native platforms, sponsored by Rerun. The major new feature introduced is "egui::Atom," which allows for the integration of images and text in various widgets, enhancing the flexibility of the layout engine. Atoms can be used to create more complex widgets, such as buttons, checkboxes, and radio buttons, which now support mixed content and simplification of layout math. An `

What is Realtalk’s relationship to AI? (2024)

Published: 2025-07-10 | Origin: Hacker News

Dynamicland is an independent nonprofit research lab dedicated to promoting universal literacy through a humane and dynamic medium. Its mission involves creating innovative computing environments that support educational and community institutions. One of its significant initiatives, Realtalk, allows people to collaboratively explore computational models using physical materials in a real-world setting. From 2017 until the onset of Covid, Dynamicland operated a community workspace in Oakland, California, fostering a culture of communal computing through workshops and projects that leveraged the unique environment. The organization is now

Rails Dashboards that scale – with SQL and dry-struct

Published: 2025-07-10 | Origin: /r/ruby

The text discusses the advantages of using SQL and DryStructs for generating reports and dashboards in a Ruby application, particularly in the context of ActiveRecord. While ActiveRecord is effective for basic CRUD operations and offers some aggregation methods, it falls short for complex reporting needs. Common Table Expressions (CTEs) in raw SQL are highlighted as a powerful solution for transforming operational data into a report-ready format. The content outlines how Zipline users can track message readership and task completion across teams, demonstrating this with an

Show HN: FFmpeg in plain English – LLM-assisted FFmpeg in the browser

Published: 2025-07-10 | Origin: Hacker News

The content describes an AI tool that generates commands for video and audio editing, which users can execute directly in their web browsers. Examples of commands include trimming the first 20 seconds of a video, extracting audio as an MP3 file, and mixing audio from an MP3 into a video while maintaining the video's length.

We stopped relying on bloom filters and now sort our ClickHouse primary key on a resource fingerprint. It cut our log query scans to 0.85% of blocks.

Published: 2025-07-10 | Origin: /r/programming

The content describes a significant optimization made to the log-query scanning process in ClickHouse, where the scanning of data blocks was reduced from nearly 100% to less than 1%. This was achieved by reorganizing log storage through a method that generates a deterministic "resource fingerprint" (a hash of relevant identifiers) for each log source. By sorting logs based on this fingerprint, logs from the same pod or service are stored contiguously, allowing ClickHouse to efficiently skip irrelevant blocks during queries.

Smarter Use of Stimulus’ Action Parameters

Published: 2025-07-10 | Origin: /r/ruby

The article discusses how to set up a typical text editor using a Stimulus controller, focusing on settings such as theme, line numbers, and font size. Instead of creating separate methods for each setting (like updateTheme or setLineNumbers), it suggests using a more maintainable approach by implementing a single `updateSetting` method. This method utilizes Stimulus’ action parameters to handle updates, allowing for a more streamlined and reusable code structure. The setup begins with the HTML and progresses to the JavaScript

A Century of Quantum Mechanics

Published: 2025-07-10 | Origin: Hacker News

CERN is a research organization focused on exploring the fundamental structure of particles that constitute the universe, utilizing the world's largest scientific instruments. Their mission involves conducting fundamental research, contributing to society, conducting environmentally responsible studies, fostering international collaboration, and inspiring education. Key achievements include significant discoveries like the Higgs boson and advancements in particle physics. CERN's research encompasses a wide range of topics, including antimatter, dark matter, and cosmic rays, while also promoting knowledge sharing and engaging the global scientific community.

The underground cathedral protecting Tokyo from floods (2018)

Published: 2025-07-10 | Origin: Hacker News

Tokyo has developed a sophisticated flood defense system, including dams, levees, and the Metropolitan Area Outer Underground Discharge Channel (MAOUDC), a network of tunnels and chambers designed to protect the city from flooding. Water management expert Cecilia Tortajada describes her experience visiting the impressive underground water tank and highlights Tokyo's effective strategies for coping with severe weather. However, the city's future flood resilience is uncertain due to climate change and shifting rainfall patterns, as Tokyo is already vulnerable because of its geographic location and