Skip to content

Instantly share code, notes, and snippets.

Always Coding :)

Brad Traversy bradtraversy

Always Coding :)
View GitHub Profile

Google Carbon Snippets

This file contains some of the basic syntax for Google Carbon as well as some info and how to get set up.

The official repo and docs can be found at:

Carbon is an experimental successor to C++. It is NOT ready for production and will not be for a while. This crash course and document were made to explore some of the basic syntax.

How to get started

bradtraversy /
Last active Aug 5, 2022
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys


GraphQL Queries & Mutations

These are the GraphQL queries and mutations for the YouTube course.

Get names of all clients

  clients {
bradtraversy /
Last active Aug 5, 2022
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

bradtraversy /
Created Apr 22, 2022
Laravel Xampp setup on Mac and Windows

Laravel Xampp Setup (Windows & Mac)

Install Xampp

Install Xampp from

  • Run the Xampp installer and open the Xampp control panel
  • Make sure that you enable the Apache and MySQL services
  • On mac you need to click "Start" on the Home tab, "Enable" on the Network tab and "Mount" on the Location Tab. Click "Explore" on the location tab to open your Xampp/Lampp folder

Install Composer

bradtraversy /
Last active Aug 6, 2022
Laravel Valet install on mac

Laravel Valet Setup (Mac)

This will get you setup with Laravel & Valet on your Mac. Quentin Watt has a good video tutorial on getting setup here as well

Install Homebrew

Go to and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL"

Firebase Setup For House Marketplace

  1. Create Firebase Project
  2. Create "web" app within firebase to get config values"
  3. Install firebase in your project "npm i firebase
  4. Create a config file in your project
  5. Add authentication for email/password and Google
  6. Create a user from Firebase
  7. Enable Firestore
  8. Add rules for firestore
bradtraversy / firebase_rules.txt
Last active Jul 6, 2022
Firebase rules for house marketplace app
View firebase_rules.txt
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Listings
match /listings/{listing} {
allow read;
allow create: if request.auth != null && < 7;
allow delete: if == request.auth.uid;
bradtraversy / typescript-crash.ts
Last active Aug 2, 2022
Basic intro to TypeScript (From YouTube Crash Course)
View typescript-crash.ts
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
bradtraversy /
Last active Jul 25, 2022
Python & MySQL crash course for beginners
import mysql.connector
from mysql.connector import errorcode
config = {
'user': 'root',
'password': '',
'host': 'localhost',
'database': 'acme'