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

标签:#Git

找到 1802 篇相关文章

AI 资讯

Deploying a static site to Cloudflare Workers

Originally published on indiecore.net . I moved this site off a hosted blogging platform onto Cloudflare, with GitHub Actions doing the building and Cloudflare doing the serving. It costs nothing, deploys in about two and a half minutes, and refuses to publish anything that fails its checks. Getting there took longer than it should have. Here is the setup, and the five things that tripped me up — none of which are obvious from the documentation. The shape of it git push └─ GitHub Actions ├─ build generate the site ├─ verify dead links, missing images, bad metadata, broken redirects ├─ Lighthouse fail if performance/accessibility/SEO drop below budget └─ deploy upload to Cloudflare The important part is that deploy depends on the checks . A broken build never reaches the internet. Pull requests get a preview URL; merges to main go live. The triggers and permissions that make that safe: ci-cd.yml — triggers and permissions name : CI/CD # Build and verify every change; deploy previews for PRs and production from main. # Deploy jobs depend on the quality gates, so nothing ships unverified. on : push : branches : [ main ] # The SEO watch ledger is machine-written, is never part of dist/, and is # committed daily. Deploying the site again for it would be pure noise — and # would re-trigger the SEO ping through workflow_run every single day. paths-ignore : - ' _source/seo-watch.json' pull_request : branches : [ main ] workflow_dispatch : # Least privilege by default; individual jobs elevate only what they need. permissions : contents : read # Supersede in-flight runs for a branch, but never interrupt a production deploy. concurrency : group : ci-cd-${{ github.ref }} cancel-in-progress : ${{ github.ref != 'refs/heads/main' }} env : # wrangler ships as a pinned devDependency; never phone home from CI WRANGLER_SEND_METRICS : " false" permissions: contents: read at the top means every job starts with the minimum, and only the one that comments on pull requests gets more. The c

2026-09-02 原文 →
AI 资讯

I raced six models against each other on DigitalOcean Inference. The cheapest one won.

Every time I put a model behind an endpoint I make the same lazy decision. I pick whatever I used last time, or whatever I read about most recently, and I tell myself I'll benchmark it properly later, and later never arrives because there is always something with an actual deadline on it and comparing model latencies feels like procrastination even when it isn't. I never do it. Not once. So I built the thing that would make me do it. One prompt, fired at six models at once, streaming side by side in columns, with time to first token and cost per run underneath each one. About 390 lines of Python. Code's here , MIT, take it. Then I ran it, and three things happened that I didn't plan for. The integration is two lines, and that's the least interesting part DigitalOcean's inference endpoint speaks OpenAI, so this is the whole thing: client = OpenAI ( base_url = " https://inference.do-ai.run/v1/ " , api_key = os . environ [ " DIGITAL_OCEAN_MODEL_ACCESS_KEY " ], ) Every model below goes through that one client. Llama, DeepSeek, Mistral, Qwen, OpenAI's open-weight gpt-oss line. Only the model string changes. That is the pitch, and it's real, and I'll move past it quickly because you already knew an OpenAI-compatible endpoint would work like an OpenAI- compatible endpoint. What I didn't know is everything that follows. One footnote before you paste that snippet. The credential is a model access key , created under the Gradient AI Platform. It is not the API token from Settings, API. Different thing, different page. (Although, as I found out later, the endpoint doesn't care nearly as much about that distinction as the docs do.) Six streams, no event loop I wanted the columns to fill simultaneously. Real racing, not six sequential progress bars pretending. The tidy way to do that is one endpoint that fans out server side and multiplexes everything back down a single connection. I didn't do the tidy way. The browser opens one EventSource per model instead: GET /stream?model=<

2026-09-01 原文 →
AI 资讯

CodeHub Classroom

GitHub Classroom launched in July 2013. In August 2026, it was sunset — and a lot of instructors were left scrambling for an alternative. The official recommendations point to "yet-another-online-service" - and your school might not like you sending student information (names, emails, etc.) through unknown online solutions. That was one of my pain points (among others). So I built CodeHub Classroom . 🎉 I teach computer programming at the post-secondary level. My colleagues and I needed to adjust fast. You might be scrambling for alternatives. So I'm throwing my hat in the ring with CodeHub Classroom . What it is CodeHub Classroom is a free desktop app that follows a two step Provision and Release approach to setting up student assignments as GitHub repositories. I'm baking in a lot of the features I hoped GitHub Classroom would eventually build, but never did. The core workflow is simple and deliberately opinionated, based on over a decade of actually using GitHub Classroom day-to-day: Provision — generate each student's private repository from your assignment template. Nobody has access yet. Release — invite each student as a collaborator on their own repository, exactly when you're ready. Why it's different It's built around your whole school term , not one classroom at a time. GitHub Classroom made you manage a separate "classroom" per course section. If you taught three sections of the same course, that meant duplicate setup (and possible copy/paste errors) for shared assignments. CodeHub Classroom shows every course and section you're teaching this term in one dashboard . It runs on your computer — there's no backend. No GitHub App, no shared service account, nothing for GitHub to rate-limit. It just drives the git and GitHub CLI ( gh ) tools you probably already have installed. If you've got the GitHub CLI, you already had everything CodeHub needs. On privacy This one matters to me, so I'll say it plainly: I built CodeHub Classroom so that ALL your classroom d

2026-08-31 原文 →
AI 资讯

The Day I Became the One Being pip Installed: My Pre-Release Checks Caught 3 Leaks

(Translation of my Japanese article on Zenn.) This is part 4 of a series where I keep delegating implementation to AI without being able to read the code, building a vulnerability triage CLI called triage-lens. This installment is about distribution rather than the tool's internals: the tool had been sitting on GitHub, and I published it to PyPI so a single pip install triage-lens brings it in. A confession first. Shipping took more nerve than any of the feature work did. And three "leaks" actually turned up right before release. From the installing side to the installed side I can't read code, but I have typed pip install before. Years ago I dabbled in Python out of curiosity, and the one thing that stuck was the experience of a useful tool arriving in one line. Now that I'm the one publishing, the other side of that one line finally became concrete. Someone builds a thing, shapes it into a package, and puts it on the public shelf called PyPI. That's why it installs in one line anywhere in the world. My turn to put something on the shelf. I delegated the release work to AI too: package metadata, the release workflow, and one thing I insisted on. Instead of an API token, authentication to PyPI uses Trusted Publishing (OIDC). Nothing like a long-lived password gets stored anywhere; you declare "trust publishes from this workflow in this GitHub repository" and that's it. A secret you never hold is a secret that can't leak. The pre-release check caught three real ones In this project, nothing goes out to a public repository without passing a mechanical check. Procedures and tests, not eyeballs, verify that no personal or development-only information is mixed in. For three releases it came up empty. That's what insurance looks like. On the fourth run it caught something real. Three somethings. First, test code had slipped into the distribution. The packaging tool's default behavior had a path where the whole development test suite gets bundled along. I was about to scat

2026-08-31 原文 →
AI 资讯

Running Coding Agents in Parallel with Git Worktrees

I kept hitting the same wall with coding agents. One Claude Code or Codex session in a repo works great. The moment I wanted two tasks moving at once - login in one terminal, payments in another - they started stepping on each other. Same working directory, same checked-out branch, two processes editing the same files. Chaos. The fix turned out to be a Git feature that has been sitting there for years: git worktree . It gives you several working directories backed by the same repository . Each folder has its own checked-out branch, but all of them share the same objects, commits and branch list. The setup From your main checkout: git worktree add ../integration -b integration main git worktree add ../feature-login -b feature/login main git worktree add ../feature-payments -b feature/payments main Which leaves you with something like: project/ ├── main/ → branch main ├── integration/ → branch integration ├── feature-login/ → branch feature/login └── feature-payments/ → branch feature/payments Now every agent gets its own folder. One terminal per worktree, one agent per terminal, and nobody touches anybody else's files: cd feature-login # agent 1 works here cd feature-payments # agent 2 works here, at the same time The part that surprised me: no push, no pull My first instinct was: agent finishes login, pushes the branch, then I pull it into integration. That's the muscle memory from working in a team. It's unnecessary here. All the worktrees belong to the same repository on the same machine, so Git already knows every branch locally. When agent 1 finishes: cd feature-login git add . git commit -m "feat: implement login" ...the integration worktree can merge it directly: cd ../integration git merge feature/login git merge feature/payments npm test No git push , no git pull . The directories are different, but feature/login and integration are branches of the same repo. When integration is green: cd ../main git merge integration You don't even have to wait for a worktr

2026-08-31 原文 →
AI 资讯

Ownership, and Making This Template Your Own (Part 5)

Part 4 covered how this platform actually ships — scaffolding, CI/CD, and the two deployment shapes. This closing part is the two things every one of the last four parts has assumed: who actually owns each piece of this, and what it takes to make this whole template yours. Who owns what Every piece of this platform belongs to exactly one team, and that split is what makes independent deploys survive contact with a real organization, not just a single-team demo: Piece Owned by Depends on Host / Shell Platform team Store, Components, the manifest, the identity provider Components MFE Platform / design-systems team Nothing (a leaf) Store MFE Platform team The identity provider Utilities MFE Platform team Nothing (a leaf) Domain MFE (×N) Domain team Components, Store, Utilities only Manifest Registry Platform team Nothing Identity provider(s) Outside the platform — whichever the deployment configures — Backend / BFF Domain team, or a shared gateway (Part 2) Each team's own data The rule underneath the table: domain teams never import from each other, only from the shared platform layer. That keeps the dependency graph a strict two-level tree — Host → platform layer → domain leaves — instead of a mesh, which is what keeps independent deployability tractable once there's more than a handful of domain teams. It's the same rule that made every part of this series possible to write in isolation: Part 3's auth flow doesn't need to know Part 4's deploy pipeline exists, and neither needs to know how many domain teams there eventually are. Making this template your own Everything organization-specific in this platform — branding, which identity provider(s) it trusts, where the manifest lives — has lived in one file across this entire series, on purpose: // platform.config.json { "orgName" : "acme-corp" , "branding" : { "primaryColor" : "#0B5FFF" , "logoUrl" : "..." }, "idp" : { "issuers" : [ { "id" : "primary" , "issuer" : "https://issuer.example.com" , "clientId" : "..." , "def

2026-08-31 原文 →
开发者

I Built a Free Tool That Turns Your GitHub Profile Into a Shareable Stat Card — Here's How

The Problem GitHub profiles are data-rich but visually boring Developers want to "flex" their stats but have no aesthetic way to do it The Solution DevCard: enter username → pick theme → download PNG Show all 3 themes with screenshots How It Works (Architecture) Cloudflare Worker + GitHub GraphQL API (single query) Edge caching strategy Client-side rendering with html-to-image The CORS avatar trick (base64 conversion) The RPG Class System (fun section) How top language maps to character class Full class table (TypeScript → Archmage, Rust → Forgemaster, etc.) This section alone will get shares Try It Yourself Link: https://www.devcard.tech/ CTA: "Drop your card in the comments" What's Next VS Mode (compare two devs) More themes Open to suggestions

2026-08-30 原文 →