Skip to content

Commit 047bb55

Browse files
committed
Fix homebrew + gitguardian installation sections
1 parent cb5f1f2 commit 047bb55

File tree

4 files changed

+39
-21
lines changed

4 files changed

+39
-21
lines changed

src/components/ShareButtonTracked.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
'use client'
22
import ShareButton from './ShareButton'
33
import { track } from '@vercel/analytics'
4+
import { useSession } from 'next-auth/react'
5+
import { usePathname } from 'next/navigation'
46

5-
export default function ShareButtonTracked(props) {
7+
export default function ShareButtonTracked({ location = 'top', ...props }) {
8+
const { data: session } = useSession();
9+
const pathname = usePathname();
10+
const url = typeof window !== 'undefined' ? window.location.origin + pathname : pathname;
611
return (
712
<ShareButton
813
{...props}
914
onCopy={() => {
10-
track('share-guide', { location: 'top' })
15+
track('share-guide', {
16+
location,
17+
url,
18+
email: session?.user?.email || undefined,
19+
authenticated: !!session?.user,
20+
})
1121
}}
1222
/>
1323
)

src/content/blog/vibe-coding-guide/page.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,9 @@ Run `git add . && git commit -m "test"` to save your code.
201201
<Link href="/products/vibe-coding-mastery">
202202

203203
</Link>
204+
205+
<div className="flex justify-center my-8">
206+
<ShareButtonTracked buttonText="Share this guide" location="bottom" />
207+
</div>
208+
204209
*Premium unlocks screencasts, exact commands, tools that auto-block leaks before they happen, and custom Cursor Rules to help you learn and protect you as you vibe code.*

src/content/blog/vibe-coding-mastery/page.mdx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import gitGuardian from '@/images/git-guardian-flow.webp'
1313
import gitPopped from '@/images/git-popped.webp'
1414
import gitignore from '@/images/gitignore.webp'
1515
import neverCommitEnv from '@/images/never-commit-env.webp'
16+
import homebrew from '@/images/homebrew.webp'
1617
import secretsFlow from '@/images/secrets-flow.webp'
1718
import secretsLeak from '@/images/secrets-leak.webp'
1819
import secretsVsNonSecrets from '@/images/secrets-non-secrets.webp'
@@ -21,8 +22,6 @@ import cursorRules from '@/images/cursor-rules.webp'
2122
import { createMetadata } from '@/utils/createMetadata';
2223
import { importContentMetadata } from '@/lib/content-handlers'
2324

24-
Perfect — thanks for the schema. Here’s the corrected version of the metadata object using the contentSections array with properly structured title and subsections, accurately reflecting your guide’s TOC and flow:
25-
2625
export const metadata = createMetadata({
2726
author: "Zachary Proser",
2827
date: "2025-05-04",
@@ -149,8 +148,6 @@ export const metadata = createMetadata({
149148
}
150149
});
151150

152-
Ready to drop in. Let me know if you’d like to add videoGallery or resourceLinks metadata fields next.
153-
154151
<Image
155152
src={vibeCodingPremium}
156153
alt="Vibe coding survival guide hero"
@@ -326,7 +323,9 @@ Git's history makes it easy to accidentally expose secrets, even if you later de
326323

327324
To prevent these accidents, you need a tool that integrates with Git and scans for secrets before they ever leave your machine. **GitGuardian** is purpose-built to catch these mistakes at commit time, blocking leaks before they happen.
328325

329-
### Install Homebrew (macOS Only)
326+
### Step 1. Install Homebrew (macOS Only)
327+
328+
<Image src={homebrew} alt="Homebrew is a package manager for MacOSX and Linux" />
330329

331330
Before you can install GitGuardian or many other developer tools, you'll want to set up [Homebrew](https://brew.sh)—the most popular package manager for macOS. Homebrew makes it much easier to install and manage software on your Mac.
332331

@@ -350,30 +349,25 @@ Below is a quick video walkthrough of the Homebrew installation process:
350349
Your browser does not support the video tag.
351350
</video>
352351

353-
**Next, install GitGuardian globally so it can protect all your projects by default:**
354352

355-
> This step sets up GitGuardian's pre-commit protection for every repository on your machine, not just the current one. It's the recommended way to ensure you never accidentally leak secrets, even in new or cloned projects.
353+
## Step 2. Install GitGuardian using Homebrew
356354

357-
```bash
358-
ggshield install -m global
359-
```
355+
Now that you have the Homebrew package manager installed, you can use it to install GitGuardian,
356+
the tool that protects you from leaking secrets.
360357

361-
*You'll see a confirmation message that GitGuardian's pre-commit hook is now active globally. From now on, every time you try to commit, your code will be scanned for secrets before anything leaves your computer.*
362-
363-
### Install GitGuardian
364358
<Image src={gitGuardian} alt="Git Guardian runs before your commit is even made" />
365359

366360
GitGuardian integrates with Git to automatically scan your code for secrets *before* you commit them.
367361

368-
Before you start pushing code to GitHub, it's smart to set up a tool that will catch any secrets you accidentally commit. [GitGuardian](https://www.gitguardian.com/) scans your code for API keys and other sensitive info before it ever leaves your machine.
369-
370362
**How to install GitGuardian's CLI (`ggshield`) with Homebrew:**
371363
1. Open the terminal in Cursor
372364
2. Paste and run this command:
373365
```bash
374366
brew install gitguardian/tap/ggshield
375367
```
376368

369+
**Note: this one may take a while, especially if your connection is slow. Be patient and let it complete.**
370+
377371
Below is a quick video walkthrough of the installation process:
378372

379373
<video
@@ -394,13 +388,22 @@ When you try to commit:
394388
2. GitGuardian scans the files you're trying to commit.
395389
3. If it finds anything that looks like a secret (API key, password pattern, etc.), it blocks the commit and tells you exactly where the problem is.
396390

397-
🖼️ **[Diagram Needed]: Commit attempt -> Pre-commit hook triggers GitGuardian -> Scan files -> Secret found? -> Block commit / Allow commit.**
391+
GitGuardian is an excellent tool, and if used properly makes it **impossible** for you to leak secrets via Git.
392+
393+
## Step 3. install GitGuardian globally
394+
395+
GitGuardian can be installed globally. Globally means that it will run
396+
ANY time you try to commit code in ANY project - **not just the project you're working in now**.
397+
398+
This is the preferred way to install GitGuardian and I highly recommend it.
398399

399-
### Test the Protection
400+
> This step sets up GitGuardian's pre-commit protection for every repository on your machine, not just the current one. It's the recommended way to ensure you never accidentally leak secrets, even in new or cloned projects.
400401
401-
See GitGuardian in action!
402+
```bash
403+
ggshield install -m global
404+
```
402405

403-
🎬 **[Screen Recording Needed]: Trying to commit a file containing a fake API key and showing how GitGuardian blocks it.**
406+
*You'll see a confirmation message that GitGuardian's pre-commit hook is now active globally. From now on, every time you try to commit, your code will be scanned for secrets before anything leaves your computer!*
404407

405408
# Setting Up Cursor Rules for Safety and Mentorship
406409

src/images/homebrew.webp

78.8 KB
Loading

0 commit comments

Comments
 (0)