Skip to content

Commit 367d26f

Browse files
authored
Merge pull request #725 from zackproser/vibe-coding-premium
Fix homebrew + gitguardian installation sections
2 parents a93e704 + 40cf33d commit 367d26f

File tree

4 files changed

+40
-34
lines changed

4 files changed

+40
-34
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: 23 additions & 32 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"
@@ -260,22 +257,10 @@ The standard git flow is:
260257

261258
Most secrets leaks occur because people don't realize that their .env file is committed to git.
262259

263-
Let's get your code saved and backed up.
264-
265-
🎬 **[Screen Recording Needed]: Setting up Git for the first time (if needed) and making your initial commit.**
266-
🎬 **[Screen Recording Needed]: Pushing your first commit to GitHub.**
267-
🖼️ **[Diagram Needed]: Simple Git flow: modify -> add -> commit -> push.**
260+
So, let's get your code saved and backed up to GitHub correctly, without leaking your API keys.
268261

269262
### Set Up Your Remote on GitHub
270263

271-
<div className="not-prose my-6">
272-
<div className="bg-zinc-50 dark:bg-zinc-900/60 border border-zinc-200 dark:border-zinc-700/40 rounded-lg p-4 shadow-md text-center">
273-
<strong>🎬 Creating your first GitHub repo and pushing to it — takes 60 seconds.</strong>
274-
<br />
275-
<em>(Screencast coming soon!)</em>
276-
</div>
277-
</div>
278-
279264
To back up your code and collaborate with others, you'll want to push your project to GitHub. If you don't have a GitHub account yet, <a href="https://github.com/signup" target="_blank" rel="noopener noreferrer" className="text-blue-600 underline">create one here</a>.
280265

281266
**Step-by-step:**
@@ -326,7 +311,9 @@ Git's history makes it easy to accidentally expose secrets, even if you later de
326311

327312
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.
328313

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

331318
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.
332319

@@ -350,30 +337,25 @@ Below is a quick video walkthrough of the Homebrew installation process:
350337
Your browser does not support the video tag.
351338
</video>
352339

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

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.
356-
357-
```bash
358-
ggshield install -m global
359-
```
341+
## Step 2. Install GitGuardian using Homebrew
360342

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.*
343+
Now that you have the Homebrew package manager installed, you can use it to install GitGuardian,
344+
the tool that protects you from leaking secrets.
362345

363-
### Install GitGuardian
364346
<Image src={gitGuardian} alt="Git Guardian runs before your commit is even made" />
365347

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

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-
370350
**How to install GitGuardian's CLI (`ggshield`) with Homebrew:**
371351
1. Open the terminal in Cursor
372352
2. Paste and run this command:
373353
```bash
374354
brew install gitguardian/tap/ggshield
375355
```
376356

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

379361
<video
@@ -394,13 +376,22 @@ When you try to commit:
394376
2. GitGuardian scans the files you're trying to commit.
395377
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.
396378

397-
🖼️ **[Diagram Needed]: Commit attempt -> Pre-commit hook triggers GitGuardian -> Scan files -> Secret found? -> Block commit / Allow commit.**
379+
GitGuardian is an excellent tool, and if used properly makes it **impossible** for you to leak secrets via Git.
380+
381+
## Step 3. install GitGuardian globally
398382

399-
### Test the Protection
383+
GitGuardian can be installed globally. Globally means that it will run
384+
ANY time you try to commit code in ANY project - **not just the project you're working in now**.
400385

401-
See GitGuardian in action!
386+
This is the preferred way to install GitGuardian and I highly recommend it.
387+
388+
> 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.
389+
390+
```bash
391+
ggshield install -m global
392+
```
402393

403-
🎬 **[Screen Recording Needed]: Trying to commit a file containing a fake API key and showing how GitGuardian blocks it.**
394+
*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!*
404395

405396
# Setting Up Cursor Rules for Safety and Mentorship
406397

src/images/homebrew.webp

78.8 KB
Loading

0 commit comments

Comments
 (0)