今日已更新 111 条资讯 | 累计 32441 条内容
关于我们

今日精选

HOT

最新资讯

共 32441 篇
第 1217/1623 页
开源项目 GitHub Trending

🔥 music-assistant / server - Music Assistant is a free, opensource Media library manager

GitHub热门项目 | Music Assistant is a free, opensource Media library manager that connects to your streaming services and a wide range of connected speakers. The server is the beating heart, the core of Music Assistant and must run on an always-on device like a Raspberry Pi, a NAS or an Intel NUC or alike. | Stars: 1,676 | 6 stars today | 语言: Python

2026-06-13 00:00 6 原文
AI 资讯 Dev.to

TypeScript TS2802 Error: Resolving Observer Pattern 'Set' Spread with Array.from Conversion

TypeScript Compile Error TS2802: Resolved with Observer Pattern by Converting Set Spread to Array.from If you're stuck implementing the observer pattern due to TypeScript compile error TS2802, this post might help. I resolved the issue with a simple conversion: changing Set spread to Array.from() . Attempts and Pitfalls While implementing the observer pattern, I encountered TypeScript compile error TS2802 when trying to spread a Set. Initially, I suspected the Set's type might be the problem, so I tried various approaches. class Observer { private subscribers = new Set < () => void > (); subscribe ( callback : () => void ) { this . subscribers . add ( callback ); } notify () { // TS2802 error occurs here for ( const callback of [... this . subscribers ]) { callback (); } } } When attempting to spread the Set into an array using [...this.subscribers] as shown above, TypeScript failed to recognize it properly, throwing an error similar to TS2802: Cannot find module '...' or its corresponding type declarations. . At first, I thought it was a library configuration issue and spent a considerable amount of time lost. The Cause In the end, the problem lay with the Set spread syntax itself. When TypeScript applies the ... spread operator to a Set, there were instances where it couldn't accurately infer the types internally. This issue can be more pronounced in certain versions or environments. The Solution To resolve this, I used the method of explicitly converting the Set spread to an array using Array.from() . class Observer { private subscribers = new Set < () => void > (); subscribe ( callback : () => void ) { this . subscribers . add ( callback ); } notify () { // Resolved by converting with Array.from for ( const callback of Array . from ( this . subscribers )) { callback (); } } } By using Array.from(this.subscribers) , TypeScript clearly recognizes the Set as an array, allowing the loop to execute correctly. The Outcome The TypeScript compile error TS2802 was cleanl

박준희 2026-06-13 00:00 11 原文
AI 资讯 Dev.to

DigitalOcean vs Vultr: The AWS Alternatives Small Businesses Actually Need

A quick note on the links below. The DigitalOcean and Vultr links in this article are referral links. If you sign up via them, you get a free credit on your new account (currently $200 over 60 days for DigitalOcean and up to $300 for Vultr) and the author of this article gets a small referral credit too, at no extra cost to you. AWS does not run an equivalent referral program, so the AWS links are normal links. The review below is the author's own evaluation; the credits do not change the recommendations. If you have ever spent a workday watching your website refuse to load, you are not alone. In a recent outage , a single building in Northern Virginia hosting one of Amazon's availability zones (the cloud-industry term for one campus's worth of servers in one region ) got too hot. The hardware shut itself down. AWS calls this a thermal event. Customers around the world have other names for it. Big enterprises ride out outages like this. They have multi-region setups, dedicated SRE teams, and SLA credits that will refund a small fraction of their monthly bill. Small and mid-size businesses do not. They lose a day of revenue, scramble to reassure customers, and then read a post-mortem in a few weeks that explains what went wrong in language that does not help them recover the lost revenue. The cloud was supposed to make small businesses look big. After each new outage, it is fair to ask: is AWS actually the right cloud for small businesses at all? Two providers worth a serious look, DigitalOcean and Vultr , are simpler, cheaper at the entry level, and built around use cases that more closely match what a small business actually needs. Here is what each one does, where AWS is still the right answer, and how to decide. Why AWS hits small businesses harder than big ones When a giant company has an AWS outage, three teams kick into gear. There is the engineering team that fails workloads over to a backup region. There is the customer-success team that updates the status p

Arthur 2026-06-13 00:00 9 原文
AI 资讯 Dev.to

Two HNG Tasks That Taught Me More Than the Spec: OAuth for Three Clients, and Shipping AI on a Team Deadline

Two HNG Tasks That Taught Me More Than the Spec This is my Stage 9B write-up for the HNG internship . No new code just two tasks that stuck: one I owned solo across multiple repos, and one I shipped inside a team product under real deadline pressure. If you've ever had auth work almost done for three days straight, or watched an LLM politely ignore your JSON schema, you'll recognize these stories. Task 1 (Individual): Insighta Labs — One API, Three Clients, One Auth System Stage: 3 (Technical Requirements Document / TRD track) Why I picked it: Auth looked "done" on paper. It wasn't. Web portal, CLI, and graders all needed to log in differently, and every environment (localhost, Railway, preview URLs) found a new way to break. What it was Insighta Labs is a queryable profile-intelligence API I built during HNG. By Stage 3 the backend wasn't just CRUD anymore it needed GitHub OAuth with PKCE , JWT access + refresh with rotation , RBAC ( admin vs analyst ), rate limits, API versioning, and three first-class clients : Client Repo How it authenticates Backend API HNG_STAGE-1 Issues tokens, sets cookies Web portal Insighta-WebPortal HTTP-only cookies + CSRF CLI Insighta-Cli PKCE + local callback + Bearer tokens Every /api/* route required X-API-Version: 1 and a valid session. Access tokens expired in 3 minutes ; refresh tokens in 5 minutes with rotation. That sounds harsh, it was intentional, and it surfaced bugs fast. The problem it was solving Reviewers and real users had to prove identity without sharing one login mechanism. Browsers should never see raw tokens in JavaScript. The CLI can't use cookie redirects the same way a React app does. Automated graders needed a test path that didn't depend on GitHub's OAuth exchange. One auth design. Three runtimes. Zero "works on my machine only." How I approached it I split auth into explicit paths instead of one generic "login" handler: Web flow GET /auth/github — server stores PKCE verifier, redirects to GitHub GET /auth/gith

EMMANUEL UMEH 2026-06-12 23:59 13 原文