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

标签:#MacOS

找到 27 篇相关文章

开发者

Dawn or Eclipse — a code-breaking ode to Turing you can't outsource to the machine

As I sat in my RV, sipping coffee and staring at lines of code, I couldn't help but think of Alan Turing. The father of computer science, Turing's work on the theoretical foundations of modern computer science is still widely influential today. I've always been fascinated by the story of how he cracked the Enigma code, and how that achievement played a significant role in the Allied victory in World War II. This got me thinking about the balance between human intuition and machine automation in our work as developers. One particular challenge I faced while building Tab Reminder, a Chrome extension that allows users to schedule tabs to reopen later, was finding the right balance between automation and user input. From a technical standpoint, implementing the scheduling feature required a deep dive into Chrome's extension APIs, particularly the alarms API. I had to ensure that the extension could reliably store and retrieve scheduled tabs, even when the user closed their browser or restarted their computer. The key insight here was using the alarms API to trigger a background script that would reopen the scheduled tabs at the specified time. One lesson I learned from this experience is that while automation can greatly simplify many tasks, there are still areas where human judgment and oversight are essential. For instance, when a user schedules a tab to reopen, they may have specific intentions or context in mind that the machine can't fully understand. By providing a simple, intuitive interface for scheduling tabs, Tab Reminder fills a gap that more automated solutions might overlook. You can try it out for yourself at https://go.sg1-labs.us/tab-reminder . As developers, we must recognize the limitations of automation and ensure that our tools and applications are designed to augment, rather than replace, human capabilities.

2026-07-13 原文 →
AI 资讯

Planting a Future Breaking Change Today: A launchd Timer Job That Deletes Itself When Done

This is a follow-up to my earlier post, " Automating a config migration with a one-shot launchd job ." Some breaking changes come with a known expiration date, and you can prepare for them long before they land. This time the external event was the end-of-life of Fable 5 (2026-07-07), and I'll walk through how I designed a launchd job you set up today, that fires only on the target day, and that removes itself once it's done. The whole thing started with the thought, "manually fixing this on the shutdown day is going to be annoying." But I also didn't want to run a script every morning that needlessly rewrites JSON. What I landed on was a three-part set: a date gate, a jq rewrite with a backup, and self-unload. The problem: on the day I learn about a deprecation, I want to plant a job that "only runs on the target day" Right now, ~/.claude/settings.json looks like this: { "model" : "claude-fable-5[1m]" , ... } The moment I learned Fable 5 would end on 2026-07-07, creating a calendar reminder to manually rewrite this "model" felt too flimsy — I'll forget. On the other hand, making "a daemon that checks the date every time it boots" is overkill. What I wanted was a job I could set once and leave alone, that runs when the day arrives, and then disappears. launchd can fire at a specified time via StartCalendarInterval . But you can't express "just once at 9:00 on 7/7"; you need a combination of recurring and date-fixed slots. Specifying multiple slots and absorbing the redundancy with idempotency is the standard trick on macOS launchd. The implementation: the three-part set Here's the full ~/.claude/scripts/model-transition-0707.sh (comments omitted). #!/bin/bash set -uo pipefail SETTINGS = " $HOME /.claude/settings.json" LOG = " $HOME /.claude/logs/model-transition.log" PLIST = " $HOME /Library/LaunchAgents/com.shun.model-transition-0707.plist" log () { echo "[ $( date '+%F %T' ) ] $* " >> " $LOG " ; } # ① 日付ゲート if [ " $( date +%Y%m%d ) " -lt 20260707 ] ; then log "ski

2026-07-11 原文 →
AI 资讯

Stop Rebuilding the Same SwiftUI Components: A Guide to DesignFoundation

"I'll just write a quick button style... and a text field with validation... and a card component..." Two weeks later you have a bespoke design system that only half the app uses, three slightly different buttons, and nothing shipped. If you're building with an AI coding agent, the drift problem is worse, not better. Ask Claude, Cursor, or Codex to "add a settings screen" three separate times and you'll get three different paddings, three different corner radii, and a button style that quietly forked itself somewhere around commit 40. Agents are great at writing plausible SwiftUI and bad at remembering what the rest of your app already decided. DesignFoundation is an open-source SwiftUI package that gives you a token-based theming engine, 25 components, and 6 feedback/overlay modifiers that all read from the same theme. You set it once at the app root, and everything underneath updates. That's the whole idea — and it ships with CLAUDE.md , AGENTS.md , and Cursor rules already written, so an agent working in your repo reaches for DFButton instead of inventing a new one. In this tutorial you'll go from zero to a themed, consistent SwiftUI UI — without writing a single custom button style. What We're Building By the end you'll have: A working app that uses DesignFoundation's theme system A themed form with inputs, validation states, and feedback components A custom theme built from tokens An understanding of how the style system composes Requirements: Xcode 16+, iOS 18+ / macOS 15+ target, Swift 6. Installation Via Xcode File → Add Package Dependencies Paste https://github.com/NerdSnipe-Inc/design-foundation Set the version rule to Up to Next Major from 1.0.0 Add DesignFoundation to your target Via Package.swift dependencies : [ . package ( url : "https://github.com/NerdSnipe-Inc/design-foundation" , from : "1.0.0" ) ], targets : [ . target ( name : "YourApp" , dependencies : [ "DesignFoundation" ]) ] Step 1: One Line Instead of a ThemeManager Singleton Every app that

2026-07-07 原文 →
AI 资讯

Stop Rebuilding Auth, Onboarding, and Dashboards: DesignFoundationPro

Part 2 of 2. This tutorial builds on Part 1 — DesignFoundation core . If you haven't added the base package and theme yet, start there. The core package gives you tokens and primitives. DesignFoundationPro adds what comes next — 29 blocks, 47 screens, 18 navigation shells, and 9 runnable composition examples across auth, onboarding, charts, data tables, and full product verticals. The docs claim ~87% fewer lines of code versus building from scratch. That's the bet. This matters even more if an AI coding agent is doing the building. Ask an agent for a CRM screen and a settings screen in the same session and, without guardrails, you'll get two different takes on spacing, two different sidebar behaviors, and a table that's native on Mac in one screen and a scroll view pretending to be a table in the other. Pro ships with that guardrail already in place — more on that in Where to go from here. How the two packages relate Pro sits on top of Foundation and re-exports it. Import only DesignFoundationPro and you get everything from both: YourApp your models, data, routing DesignFoundationPro 29 blocks · 47 screens · 18 shells · 9 examples DesignFoundation tokens · primitives · validation · theme engine · MIT Access: Foundation is MIT and public. Pro is a commercial add-on — repo access is granted after purchase. Licenses are lifetime (no subscription); annual updates are $39/year and entirely optional. Pricing: $149 individual · $449 team (up to 5 devs). Before buying, browse everything in DFPlayground — a free macOS app that lets you preview all 29 blocks, 47 screens, and 18 shells with live theming. Step 1: Add DesignFoundationPro Pro declares Foundation as its own dependency and re-exports it via @_exported import DesignFoundation . Add only the Pro package — Foundation comes with it automatically. The Pro repo URL is provided after purchase — contact nerdsnipe.inc@gmail.com or visit the Pro page to get access. dependencies : [ . package ( url : "https://github.com/NerdS

2026-07-07 原文 →
AI 资讯

Popular Tags: How I Used Browser Storage to Efficiently Manage User Data

As a solo developer working out of an RV, I've learned to appreciate the importance of staying organized, especially when it comes to managing user data in my Chrome extension, Tab Reminder. One of the key challenges I faced was efficiently storing and retrieving user-scheduled tabs, which led me to explore the world of popular tags in browser storage. During the development of Tab Reminder, I realized that using a simple key-value pair system wasn't enough to manage the complexity of user data. I needed a way to categorize and prioritize scheduled tabs, which is where popular tags came into play. By utilizing the localStorage API, I was able to store user-defined tags and associate them with specific tabs, making it easier for users to manage their scheduled tabs. One technical insight I gained from this experience was the importance of using a robust data structure to store user data. In my case, I used a combination of arrays and objects to store tag information, which allowed me to efficiently query and update user data. For example, when a user schedules a new tab, I use the following code to store the tag information: // Store tag information in localStorage const tags = JSON . parse ( localStorage . getItem ( ' tags ' )) || {}; tags [ tabId ] = tagName ; localStorage . setItem ( ' tags ' , JSON . stringify ( tags )); One lesson I learned from this experience is that even small, useful tools like Tab Reminder require careful consideration of data management. By leveraging popular tags and a robust data structure, I was able to create a seamless user experience that allows users to efficiently manage their scheduled tabs. If you're interested in trying out Tab Reminder, you can check it out at https://go.sg1-labs.us/tab-reminder .

2026-06-29 原文 →
AI 资讯

Swift 6.4 Brings New Language Features and Swift Testing/XCTest Interop

Currently available as a beta in Xcode 27, Swift 6.4 introduces a range of enhancements: better C interoperability, simplified OS availability check, fine-grained warning control, async support in defer, efficient iteration for non-noncopyable types, up to 4x faster URL parsing, and improved interoperability between Swift Testing and XCTest. By Sergio De Simone

2026-06-28 原文 →
AI 资讯

How to add license keys to a SwiftUI macOS app (in under an hour)

You built a Mac app, you want to sell it outside the App Store, and now you need licensing: a key the customer enters, an activation that sticks, and feature gates that hold up offline. Here's how to do it in an afternoon without standing up a backend. Note: this is cross-posted from the Keylight blog . I build Keylight, so this uses it as the worked example — the shape of the solution applies whatever SDK you choose. The three things licensing actually has to do Strip away the marketing and every licensing system does exactly three jobs: Activate — turn a key the user pastes in into proof-of-purchase bound to this device. Verify — on every launch, confirm that proof is still valid, including offline . Gate — unlock features based on the tier/entitlements the license carries. If you build this by hand you're writing a server, a crypto layer, and a state machine. The point of an SDK is to skip all three. 1. Add the SDK Add the Swift package in Xcode (File ▸ Add Package Dependencies) pointing at the Keylight Swift SDK, then configure it once with your tenant key at app launch: import Keylight let keylight = Keylight ( tenant : "your_tenant_key" ) 2. Activate a key Give the user a text field and call activate . This is the one online step — it exchanges the key for a signed, device-bound lease that's stored locally: do { try await keylight . activate ( key : enteredKey ) // lease stored — the app is now licensed on this device } catch { // show the user why: invalid key, device limit reached, etc. } 3. Verify on launch (offline-safe) On every subsequent launch you don't hit the network. The SDK verifies the stored lease's Ed25519 signature locally and hands you a state: switch keylight . checkOnLaunch () { case . licensed ( let lease ): unlockApp ( entitlements : lease . entitlements ) case . trial ( let daysLeft ): runTrial ( daysLeft : daysLeft ) case . expired , . invalid : showActivationScreen () } No server call, so the app opens instantly and works on a plane. Th

2026-06-27 原文 →
AI 资讯

I compared the licensing tools for my indie Mac app — the honest breakdown

I needed to license a macOS app I sell outside the App Store. I went down the rabbit hole so you don't have to. Here's the honest breakdown — what each tool is genuinely good at, and where it stops. No tool is "best"; they're good at different things. The two questions that decide everything Before the tools, answer these: Do you need real offline verification? (Desktop apps usually do — see firewalls, planes, air-gapped machines.) This eliminates the "license key is just a string you check over HTTP" options for serious use. Do you want payments handled too, or do you already have Stripe? Some of these are licensing-only; some are merchant-of-record that also do keys. The licensing-first tools Keygen — the one most people name first. Language-agnostic API, deep policy engine, open-source, self-hostable. Genuinely powerful. The cost is that it's primitives : you bring your own payments, wire the webhooks, and write the client code. Pick it when you want maximum control and don't mind assembling the flow. Cryptolens — classic license-key system with offline verification via signed responses. Strong .NET heritage. Solid if you're on Windows/.NET and want the traditional key + activation-count model. LicenseSpring — enterprise-leaning. Floating licenses, air-gapped activation, node-locking. Overkill for a solo indie app, right at home if you're selling into companies with offline/dark-site requirements. The payments-first tools (keys as a feature) Lemon Squeezy / Polar — merchant of record, so they handle sales tax for you, with a license-key API bolted on (activate / validate / deactivate). Great for getting paid fast across borders. The licensing side is basic — keys are essentially strings with an activation limit; offline verification isn't really their thing. Gumroad — the simplest possible "sell a thing, get a license key, verify over one endpoint." Fine for a cheap utility where piracy isn't worth fighting. Not infrastructure. StoreKit — only relevant if you shi

2026-06-27 原文 →
AI 资讯

How offline license activation actually works

If you ship a desktop app outside an app store, you eventually hit the same wall: how do you check a license when the user is on a plane, behind a corporate firewall, or just offline? Calling your server on every launch isn't an option. Here's how offline activation actually works, without the hand-waving. The naive version, and why it breaks The first thing everyone reaches for is "call home on launch, get back yes/no." It works in the demo and fails in the wild: No network = no app. Fail-closed locks out paying customers. Fail-open means anyone who blocks your domain runs free. Both are bad. A boolean is forgeable. If your app trusts a {"valid": true} response, a proxy or a patched DNS entry returns that for free. The fix isn't a better endpoint. It's moving the trust off the network and onto cryptography. The model that works: signed leases The durable pattern is a cryptographically signed lease (Keygen calls these license files, Keylight calls them leases — same idea): On first activation, the device talks to the server once . The server returns a small signed document: the license state, an expiry, the device binding, and any entitlements (which features/tiers are unlocked). The document is signed with the server's private key (Ed25519 is the modern choice — small, fast, boring in the good way). Your app ships the matching public key and verifies the signature locally on every launch. No network needed. Because the app only ever verifies with a public key, there's nothing secret in the binary to steal, and a forged lease fails the signature check. That's the whole trick: the server vouches once, math vouches forever after. first launch ──► server signs lease (Ed25519, private key) ──► stored on device every launch ──► app verifies signature (public key) ──► no network Device binding (so one key isn't infinite installs) A lease is bound to a device so a single license can't be pasted onto a thousand machines. The lease embeds a device fingerprint, and the SDK ch

2026-06-27 原文 →
AI 资讯

why a simple string match beat apple's nlembedding for local rag

Why a simple string match beat Apple's NLEmbedding for local RAG how apple's nlembedding drove me crazy and how i built my own hybrid search engine recently, while working on my personal ai agent (pheronagent), i was focused on perfecting its memory and retrieval system. everyone is talking about that famous acronym: rag (retrieval-augmented generation). the system is simple: i feed the agent my documents, it converts them into vectors (embeddings), and when i ask a question, it finds the most similar vectors and answers me. sounds perfect on paper, right? so, like any loyal apple ecosystem developer, instead of downloading massive models from external sources (or burning money on apis), i decided to use nlembedding—the native capability of the operating system that runs directly on-device. after all, apple had embedded this into the os; it was both fast and privacy-focused. but real life, as it turns out, doesn't progress as smoothly as wwdc presentations... where have i worked? - the first explosion it all started with a very innocent question. i had uploaded my cv to the system. while chatting with my agent, i casually asked: "where have i worked?" i expected the agent to fire up the metal cores in the background within seconds, find my cv, and list the companies for me. instead, the agent stared blankly. i opened the logs to see what the hell the search engine was doing behind the scenes. the shocking scenario was exactly this: cosine similarity between the query and my actual cv text: 0.587 the threshold i set for relevance: 0.60 it missed it by a hair! "no worries," i thought. "we can just lower the threshold a bit, make it 0.55, and call it a day." but then i saw the truly terrifying thing just one line below. for the exact same query, guess what score a completely irrelevant, junk record in the system—a list of files containing .ds_store—got? 0.59 - 0.60! wait a minute... my detailed, multi-page resume gets a score of 0.587 just because it doesn't contain th

2026-06-21 原文 →
AI 资讯

My first 24 hours with Siri AI on the Mac

I turned off Siri on the Mac years ago and never looked back. Similarly, I found Apple Intelligence so fruitless I never engage with it. But the new Siri AI coming to macOS 27 Golden Gate has at least got me slightly rethinking things. I'm still early in testing Siri AI, as I've only had […]

2026-06-13 原文 →
AI 资讯

How to Fix Udemy Videos Constantly Pausing on macOS (When Other Apps Work Fine)

It is one of the most frustrating experiences in online learning: you sit down to focus on a Udemy course, but the video player constantly pauses, freezes, or refuses to load. Meanwhile, YouTube, Netflix, and every other app on your Mac run perfectly fine. Because other platforms work without a hitch, it is easy to assume the issue lies with Udemy's servers. However, the root cause is usually a silent conflict between your browser settings, macOS security features, and Udemy’s strict digital rights management (DRM) protections. If you are stuck on a looping loading wheel, here is exactly why it happens and how to fix it in less than two minutes. Quick-Fix Troubleshooting Checklist Save or screenshot this step-by-step breakdown to instantly diagnose and fix your playback issues: Step 1: Open Chrome in Incognito Mode Open a new Incognito window ( Cmd + Shift + N on Mac). Try playing the video again. If it works: Disable ad blockers. Disable VPN privacy shields or browser extensions one at a time. If it still fails: Continue to Step 2. Step 2: Disable Hardware Acceleration Open Chrome. Go to Settings → System . Turn off Use graphics acceleration when available . Relaunch Chrome. Test the video again. Step 3: Check Mac Security and Display Connections Disconnect any external monitors or docking stations. Close applications that may interfere with video playback: Zoom Discord OBS Studio Screen recording tools Test video playback again. Step 4: Clear Temporary Browser Data Open Chrome. Go to Settings → Privacy and Security → Clear Browsing Data . Select: Cookies and other site data Cached images and files Clear the data. Restart Chrome and try again. Still Not Working? If the issue persists after completing all four steps: Update Chrome to the latest version. Update macOS. The Main Culprit: Hardware Acceleration Conflict The most common reason Udemy videos stutter or freeze on a Mac is a feature called Hardware Acceleration inside Google Chrome. What is Hardware Accelerat

2026-06-13 原文 →
AI 资讯

Microsoft is disabling Office 2019 for Mac next month

Microsoft's Office 2019 apps for Mac will stop working next month, because the company isn't renewing a certificate that validates Office licenses. Owners of Office 2019 for Mac are being warned they'll have to purchase Office 2024 or a Microsoft 365 subscription if they want to continue editing documents. Microsoft previously promised that "all your […]

2026-06-10 原文 →