AI 资讯
Stop Arguing About Code Style — Set Up Prettier, ESLint & Husky Once
Why this matters I’ve worked on a few frontend projects where code reviews turned into style debates—tabs vs spaces, semicolons, quote styles… you name it. It slows everything down and adds zero value. At some point, I realized this shouldn’t even be a discussion. So now, whenever I start a project, I set up Prettier + ESLint + Husky on day one. No debates. No manual fixes. No messy PRs. This post is exactly how I do it. 🧰 What each tool actually does Prettier → formats your code automatically ESLint → catches bad patterns & enforces rules Husky → runs checks before commits (so no one skips them) Together → clean, consistent code without thinking ⚙️ Step 1 — Install dependencies npm install -D prettier eslint husky lint-staged 🎯 Step 2 — Setup Prettier Create: prettier.config.js module . exports = { semi : true , singleQuote : true , trailingComma : ' all ' , tabWidth : 2 , }; Create: .prettierignore node_modules dist build 🔍 Step 3 — Setup ESLint Initialize: npx eslint --init Then tweak your config: .eslintrc.js module . exports = { extends : [ ' eslint:recommended ' , ' plugin:react/recommended ' , ' prettier ' ], rules : { ' no-unused-vars ' : ' warn ' , ' react/react-in-jsx-scope ' : ' off ' , }, }; 👉 Important: "prettier" disables ESLint rules that conflict with Prettier. 🔗 Step 4 — Connect ESLint + Prettier Install: npm install -D eslint-config-prettier That’s it. Now ESLint won’t fight Prettier. 🐶 Step 5 — Setup Husky Initialize Husky: npx husky init Add pre-commit hook: npx husky add .husky/pre-commit "npx lint-staged" 🚀 Step 6 — Setup lint-staged Add to package.json : "lint-staged" : { "*.{js,jsx,ts,tsx}" : [ "eslint --fix" , "prettier --write" ] } 💡 What happens now? Every time you commit: ESLint checks your code Prettier formats it Only clean code gets committed No more: “fix formatting” PR comments broken lint rules in main branch inconsistent code styles 🧠 Real impact (from experience) After adding this to a team project: PR noise dropped a lot reviews
产品设计
DeskMat 1.3
Now hide individual files + folders for more private desktop Discussion | Link
AI 资讯
Keep Rejected Options in Your Agent Decision Log
An activity log tells us what an agent did. A decision log should also tell us what it considered and rejected. Without rejected options, a later reviewer sees a clean path that never existed: model B was selected, the task restarted, the result succeeded. Missing are the reasons model A was unsuitable, why staying put was worse, and what new evidence would change the choice. That information matters for trust and recovery. It lets people challenge a decision without reconstructing the entire session. Execution history is necessary, but different The MonkeyCode model-switch record at commit c58bcd4 stores the task and user, from/to model IDs, request ID, whether to load the session, success, message, session ID, and timestamps. The switch use case creates that switch record, restarts the task with the target configuration, and records the result. That is valuable execution history. It answers “what switch was requested and what happened?” The expanded rejected-options structure below is my design proposal , not a claim about MonkeyCode's current schema or interface. Add the decision before the outcome A reusable record can separate choice from execution: { "decision_id" : "task-42-model-switch-7" , "context" : "The task needs the required tool-call contract." , "chosen" : { "option" : "model-b" , "reason" : "Passed the declared capability contract" , "evidence" : [ "evaluation/capability-model-b.json" ] }, "rejected" : [ { "option" : "model-a" , "reason" : "Required tool-call case failed" , "evidence" : [ "evaluation/capability-model-a.json" ], "revisit_when" : "Adapter version changes" } ], "execution" : { "request_id" : "req-switch-7" , "result" : "success" , "session_id" : "session-9" } } The key field is revisit_when . “Rejected” should not mean universally bad. It should mean unsuitable under a specific context and evidence set. Design the interface for progressive disclosure Do not paste this JSON into the main task timeline. Use three layers: Timeline: Switch
开发者
I Added 200+ Languages to a Translator… Then Realized Language Wasn't the Hardest Part
I'll Be Honest: The Internet Already Has Translators I know. Language translation isn't a new idea. There are already huge translation platforms out there. So when I started working on a translator for my tools website, I wasn't thinking: "I'm going to reinvent translation." Not at all. My thought was much simpler: "Can I make quick translation feel less distracting?" My Frustration Was Actually Pretty Simple Sometimes I just need to translate text. That's it. I don't want to: Create an account Open five different menus Break a long text into tiny pieces Jump between multiple tools I want to paste the text... Choose a language... And get the translation. So I Built My Own Version 👉 https://allinonetools.net/language-translator/ The tool currently supports 200+ languages and language variations . You can: Detect the source language Select the target language Translate long text Upload text Use voice input Listen to the result Copy or share the translation And I wanted to keep the text experience simple without forcing users into tiny input limits. Just: Enter → Choose Language → Translate 200+ Languages Sounded Simple Until I Saw the List English. Hindi. Gujarati. Spanish. Arabic. These are the languages most people immediately think about. But then I started going through the full language list. Abkhaz. Acholi. Afar. Alur. Aymara. Baluchi. And many more. Honestly... I hadn't even heard of some of them before building this. That was probably my biggest learning moment. I Realized How Small My Own View of the Internet Was As a developer, it's easy to build around the languages we personally know. For me, seeing English, Hindi, and Gujarati feels normal. But the internet is much bigger than my own experience. Someone somewhere may be trying to understand a sentence in a language I've never even heard spoken. That changed how I looked at this tool. The Hard Part Wasn't Adding a Dropdown A dropdown with 200+ options looks impressive. But that's not the real problem. The
AI 资讯
Why `git pull` Says "Repository Not Found" (When the Repo Exists)
The error looks like a typo in the remote URL. Usually it isn't. On a machine with more than one GitHub account signed in, this message is GitHub's way of saying wrong identity, not wrong address. The symptom A repo clone that has worked for months suddenly can't fetch or pull. The remote URL hasn't changed. The repo hasn't been renamed or deleted; you can open it in the browser just fine. Yet the command line insists otherwise: $ git pull remote: Repository not found. fatal: repository 'https://github.com/<org> /<repo>.git/ ' not found Why GitHub's error is misleading For a private repository, GitHub won't confirm or deny that the repo exists to a caller who isn't authorized to see it. Confirming would leak information about private repos to anyone probing URLs. So instead of a clear 403 Forbidden , an unauthorized request gets treated the same as a repo that truly doesn't exist: a 404 , which git renders as Repository not found . "Repository not found" on a private repo almost always means the credential attached to this request can't see it. It's rarely a wrong URL. The usual cause: two accounts, one keychain This shows up most on machines used for both personal and organization-owned work: a personal GitHub account for side projects, and a separate account (or SSO identity) that actually holds access to the org's private repos. Credential helpers cache one token per host. If the cached token belongs to the personal account, every git operation silently authenticates as that account, including ones against the org repo it has no rights to. personal-account --(switch)--> org-account Active, no repo access Has repo access Diagnose it First, confirm the remote itself is fine. $ git remote -v If the URL opens in a browser while logged into the right account, the remote isn't the problem. Next, check which credential is actually cached. On macOS with the default helper: $ git credential-osxkeychain get <<< $'protocol=https \n host=github.com' username=personal-account
AI 资讯
Five litmus tests for “this will raise your intelligence” claims
Five litmus tests for “this will raise your intelligence” claims A pocket BS detector for brain-training ads, LinkedIn gurus, and your own wishful thinking. 1. Which dial moved? Intelligence talk smuggles four dials into one word: Dial Rough meaning g / fluid ability Harder to move; overclaimed constantly Knowledge & skill Moves with practice and education Acute sharpness Sleep, illness, mood, substances Long-horizon brain health Aging, disease risk, lifestyle If the claim does not say which dial, it is marketing soup. 2. What was the control? “People got better” is almost worthless. Better than last week of the same game is practice. Better than an active control that also gets attention, novelty, and expectation is interesting. Lumosity-style lawsuits exist because companies sold soup as medicine. 3. Near or far? Near transfer: you got better at this and close cousins. Far transfer: the effect jumped to something distant (school grades, matrix reasoning, life outcomes). Far transfer is scarce. Second-order metas on cognitive training keep finding near yes, far ≈ no once bias is handled. That is not cynicism. It is how human learning usually works. 4. Who was the sample? A processing-speed protocol that helps older adults does not automatically mint IQ points for a 24-year-old optimization bro. Deficient populations respond differently than well-nourished ones. Age and baseline matter more than branding. 5. Is the score flattering the seller? If the outcome is “our app score,” the app got better at measuring app use. Prefer outcomes that hurt to fake: standardized batteries against active controls, academic scores, carefully logged real-world performance. What I built instead of another vanity mini-game IntelligenceMax is a live reasoning gym: frontier models write fresh distinction-style items at your edge, and scoring is transparent / IRT-style. That is deliberate practice under honest difficulty, not a clinical IQ battery and not a promise that general intellige
开发者
Stop Saying You Want Ownership Mindset
My 2nd article this week, I'm supposed to keep it to just once per week but whateverrr, I've had this...
AI 资讯
Siri AI Is Becoming Apple’s Everything Tool
Apple’s revamped Siri is more than a voice assistant; it’s now the backbone of the iPhone user experience. You can try it now through the iOS 27 public beta.
AI 资讯
Spin up ephemeral test inboxes for email integration tests
Most teams test email by not testing it. The send path gets a mock — expect(transport.send).toHaveBeenCalledWith(...) — and everyone agrees that's "good enough." The receive path gets skipped entirely, because there's no honest way to assert on a real inbox from a test runner. So the one part of your system that talks to the outside world over an unreliable, asynchronous, third-party channel is the part with the least coverage. That's backwards. The reason email is hard to test isn't the sending. It's the asserting . You can fire POST /messages/send all day, but to prove the message actually left, rendered correctly, and arrived with the body you expected, you need a real mailbox you control — one you can read programmatically and throw away when the run finishes. Shared Gmail test accounts almost get you there, but they bring OAuth on the runner, catch-all races between parallel workers, and a 90-day token that expires the night before a release. This post is about a different fixture: a disposable Agent Account created at the start of a CI run and deleted at the end. You mint a real mailbox per run (or per test), point your application at it, send and receive real mail, assert on the actual message body, and tear the whole thing down. No OAuth. No shared inbox. No leftover state. What an Agent Account gives you here An Agent Account is just a Nylas grant with a grant_id . That's the whole trick, and it's worth saying plainly because it's what makes this pattern cheap: an Agent Account works with every grant-scoped endpoint you already know — Messages, Drafts, Threads, Folders, Attachments, Webhooks. There's nothing new to learn on the data plane . If you've ever called GET /v3/grants/{grant_id}/messages , you already know how to read a test inbox. The difference from a normal grant is provisioning. A regular grant needs a real human to complete an OAuth flow. An Agent Account is created with a single API call — no OAuth screen, no refresh token, no human. It's a m
AI 资讯
Escalate an AI email agent's thread to a human
Most "AI email agent" demos quietly assume the agent answers everything. Point a model at the inbox, generate a reply, send it, repeat. That's a fine loop right up until the model hits a message it shouldn't touch — an angry customer, a legal question, a refund the agent has no authority to approve — and confidently fires off a reply anyway. The expensive failures in agent email aren't the threads the agent gets wrong. They're the threads the agent answers at all when it should have stepped back. So let's build the part that steps back. Not the classifier that decides a message is risky — that's triage , a separate problem. This is the handoff : once something flags a thread as "needs a human," how do you actually pull the whole conversation out of the agent's reach, park it where a person can find it, and make sure the agent keeps its hands off until that person clears it? I work on the Nylas CLI, so the terminal commands below are the exact ones I reach for when I wire up an escalation path. Every operation gets the two-angle tour: the raw curl call and the nylas command that does the same thing. What the handoff actually needs An Agent Account is, underneath, just a Nylas grant with a grant_id . That's the spine of everything here, and it's worth sitting with: there is nothing new to learn on the data plane. The same grant-scoped endpoints you already use — Messages, Threads, Folders, Drafts — work against this grant exactly the way they work against any Gmail or Microsoft grant you got through OAuth. So the escalation path isn't some special agent feature. It's three plain operations you already half-know: A place to put escalated threads. A custom folder — call it Needs human — that lives alongside the six system folders every Agent Account ships with ( inbox , sent , drafts , trash , junk , archive ). A way to move the whole thread there. Not one message — the thread . A reply is just the latest message in a conversation; a reviewer needs the full chain. A way
AI 资讯
Codegraph
How I Built CodeGraph: A Living Knowledge Graph That Tells You What Breaks Before You Break It Built for HACKHAZARDS '26 — powered by Neo4j AuraDB, tree-sitter, Groq LLaMA, and Next.js The Problem That Frustrated Me Every developer knows this feeling. You join a new codebase. There are 50,000 lines of code. Your manager says "just fix this small bug in the authentication module." You make the change. You push. And suddenly three completely unrelated features are broken — a payment flow, a notification system, and a dashboard widget you've never even looked at. You spend the next four hours tracing function calls manually, reading code you've never seen, trying to understand why changing one function in auth.py broke something in notifications.py on the other side of the codebase. This is not a rare experience. According to JetBrains' developer survey, engineers spend 58% of their time reading and understanding code — not writing it. One wrong change in a large codebase can cost hours of debugging, failed deployments, and frustrated users. I built CodeGraph to solve this. Not with another AI chatbot that guesses at your code. With a real, queryable knowledge graph that actually understands how your codebase is connected. What CodeGraph Does CodeGraph takes any public GitHub repository URL and within seconds: Parses every function in the codebase using tree-sitter Maps every call relationship between functions as a directed graph Stores everything in Neo4j AuraDB as a live knowledge graph Lets you ask questions in plain English — answered by AI grounded in real graph data The result: paste a GitHub URL, see your entire codebase as an interactive graph, click any function, and instantly know what breaks if you change it. The Tech Stack Here's what I used and why each choice mattered: Backend: Python + FastAPI (REST API server) Neo4j AuraDB (graph database — the core of everything) tree-sitter (AST parser for Python, JS, TS, TSX) Groq API with LLaMA 3.3 70B (free-tier L
AI 资讯
Yes-Brainer — A council of LLMs that debate in the browser
Yes-Brainer is a council of AI models for the decisions that aren't no-brainers. One question fans out to several models — they answer in parallel, debate to consensus, or get judged to a verdict. No backend, no accounts: your keys, your browser. For non-trivial questions — the ones that are either complex or important — I caught myself in a "ritual": copy-pasting the same prompt into Claude, then Gemini, then ChatGPT, in three browser tabs, and eyeballing the differences. The differences were the interesting part. Where the models agreed, I felt more confident. Where they disagreed, that was a nudge to give the problem a second thought and dig deeper. So I built the ritual into an app. 🧠 Yes-Brainer — a council of AI models for the decisions that aren't no-brainers. 🔗 Try it: yesbrainer.ai 🔗 Source code: github.com/trekhleb/yesbrainer One question fans out to several models at once, and instead of juggling tabs you get a deliberation in one place: 🔀 Parallel — independent answers, side by side ⚖️ Trial — the models vote anonymously on each other's answers, then a judge synthesizes a verdict 🤝 Consensus — a real multi-round debate, with a mediator that either drives it to convergence or honestly reports what stayed contested Consensus is my favourite. It's fun to watch the models drift from their original opinions under their peers' arguments. You can try all of this without pasting any keys: a few recorded demo councils are one click away on the front page. I'll walk through them below, because they show the point of the app better than the feature list. Setting up a council Creating a council is the whole setup: pick the deliberation mode, seat the models, choose who referees. The roster can mix providers freely — Anthropic, OpenAI, Google, Groq, OpenRouter, and local Ollama models can sit at the same table. Each seat shows its capabilities (vision, tools, reasoning) and context window at a glance, and each model's native abilities — web search, code execution, at
AI 资讯
Wi-Fi 8 Explained: Features, Release Date, and More
Chipset makers and router manufacturers are talking about Wi-Fi 8, but what is the new standard, and when will it arrive?
开发者
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.
产品设计
6 Best Bidets of 2026: Toto, Brondell, More, All Tested in My Bathroom
These butt-cleaning machines also offer luxe features like custom seat warming and adjustable water flows.
AI 资讯
iGarden Swim Jet X Pro 10 Review: Endless Pool
Swimming against the iGarden Swim Jet X Pro 10’s artificial current is a real workout, even if it doesn’t quite replace a full-size lap pool.
AI 资讯
Beyond ChatGPT: The AI Tools I Actually Use for Learning and Research published: false tags: ai, productivity, learning, tools
Every developer I know has the same reflex now. Hit an unfamiliar concept, paste it into ChatGPT, read the explanation, move on. I did this for months. It felt efficient. Then I noticed a pattern: I was reading a lot of clear explanations and retaining almost none of them. I could follow along perfectly in the moment and then draw a blank a week later when I actually needed the knowledge. The problem was not ChatGPT. The problem was using a general-purpose conversational tool for a job it was never designed to do. Here is what I switched to, and why it works better. The three failure modes of using a chatbot to learn Passive consumption feels like learning. Reading a good explanation triggers the feeling of understanding without the work that creates actual memory. You nod along, it makes sense, and nothing sticks. This is the biggest trap. There is no retrieval practice. The research on this is well established: you remember things by pulling them out of memory, not by putting them in repeatedly. A chatbot will explain the same concept ten different ways, but it will never make you answer a question you cannot immediately answer. That struggle is the mechanism. Confident hallucination is dangerous when you are the beginner. If you already know a topic, you can spot when an AI is subtly wrong. If you are learning it for the first time, you cannot, and you may internalize something incorrect with full confidence. For technical material, this is a real cost. What actually works better Tools that quiz you. Anything built around retrieval practice and spaced repetition beats passive reading by a wide margin. If a tool generates questions from your material and makes you answer them over spaced intervals, it is working with how memory actually forms rather than against it. Tools that read YOUR source material. This one is huge for technical learning. Instead of asking a model to answer from its general training data (which may be outdated or wrong for your specific libra
AI 资讯
How Python's Import System Works and Why It Matters for Debugging
Module caching, execution order, and circular imports explained by tracing what actually happens. How Python's Import System Works and Why It Matters for Debugging The import system is one of the least understood parts of Python and one of the most practically important for debugging production issues. Circular import errors, unexpected code execution, and module state bugs all stem from not understanding what happens when Python encounters an import statement. What Happens on the First Import When Python executes import mymodule for the first time: Python checks sys.modules for mymodule . If found, returns the cached module object immediately. If not found, Python locates the module file. Python creates a new module object and adds it to sys.modules under the module name. Python executes the module file's code in the new module's namespace. The name mymodule in the importing module is bound to the module object. Step 3 happens before step 4. This is critical for understanding circular imports. The Module Cache import sys import os print ( " os " in sys . modules ) print ( sys . modules [ " os " ] is os ) Output: True True Every imported module is cached in sys.modules . Subsequent imports return the cached object without re-executing the module code. Module-Level Code Executes on Import # config.py print ( " config module loading " ) DEBUG = True print ( f " DEBUG is { DEBUG } " ) # main.py import config import config # second import print ( config . DEBUG ) Output: config module loading DEBUG is True True The print statements in config.py run exactly once — when the module is first imported. The second import returns the cached module object without re-executing the code. Circular Import Behavior # module_a.py print ( " loading module_a " ) from module_b import b_function def a_function (): return " from a " # module_b.py print ( " loading module_b " ) from module_a import a_function def b_function (): return " from b " When you import module_a , Python starts exe
科技前沿
Best Kitchen Composters and Food Recyclers (2026)
Responsibly dispose of your food scraps with one of these indoor, (mostly) odor-free, WIRED-tested devices.
AI 资讯
When Upgrading Your AI Model Makes It Both Faster and Cheaper
Most people assume better AI performance means a bigger bill. That assumption is quietly being proven wrong. The "Don't Touch It" Trap in AI Products There's a psychological pattern that shows up in almost every team running a live AI-powered product: once something works, nobody wants to mess with it. And honestly, that instinct makes sense. You've tuned your prompts, worked out the edge cases, trained your users, and finally gotten the thing stable. The idea of swapping out the underlying model - the engine of the whole operation - feels like pulling a thread that might unravel everything. So teams stay put. They watch new model releases come out, read the benchmark comparisons, and quietly decide it's not worth the risk. The phrase you hear most often is "if it ain't broke, don't fix it." The problem is that this logic made sense when model upgrades were expensive and disruptive. That's no longer the default reality. What's actually happening now is that AI providers are competing hard on price-per-token while simultaneously improving quality. That combination - better output, lower cost - breaks the old mental model most product people are still operating with. What a Model Migration Actually Involves Let's be clear: switching AI models isn't a one-click operation. But it's also not the months-long project many teams imagine it to be. At its core, a model migration for an AI agent involves three things: re-evaluating your prompts (because different models respond differently to the same instructions), running parallel tests to compare output quality on your real use cases, and updating any API parameters that differ between versions. That's the actual work. For most small-to-medium deployments, that's days of effort, not weeks. The bigger shift is in how you think about model versions. Rather than treating the model as permanent infrastructure, it helps to think of it more like a dependency in your software stack - something you update deliberately, test careful