Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Always Coding :)

Brad Traversy bradtraversy

💭
Always Coding :)
View GitHub Profile
View carbon-lang-snippets.md

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: https://github.com/carbon-language/carbon-lang

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
bradtraversy / mern-server-setup.md
Last active Aug 5, 2022
Setup Ubuntu & Deploy MERN app
View mern-server-setup.md

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

View graphql-queries-mutations.md

GraphQL Queries & Mutations

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

Get names of all clients

{
  clients {
    name
 }
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active Aug 5, 2022
Setup Webpack with Tailwind CSS
View tailwind-webpack-setup.md

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
bradtraversy / laravel_xampp_setup.md
Created Apr 22, 2022
Laravel Xampp setup on Mac and Windows
View laravel_xampp_setup.md

Laravel Xampp Setup (Windows & Mac)

Install Xampp

Install Xampp from https://www.apachefriends.org/index.html

  • 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
bradtraversy / laravel_valet_setup.md
Last active Aug 6, 2022
Laravel Valet install on mac
View laravel_valet_setup.md

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 https://brew.sh/ and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
View firebase_setup.md

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
bradtraversy / firebase_rules.txt
Last active Jul 6, 2022
Firebase rules for house marketplace app
View firebase_rules.txt
// FIRESTORE RULES
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Listings
match /listings/{listing} {
allow read;
allow create: if request.auth != null && request.resource.data.imgUrls.size() < 7;
allow delete: if resource.data.userRef == request.auth.uid;
@bradtraversy
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
bradtraversy / python_mysql.py
Last active Jul 25, 2022
Python & MySQL crash course for beginners
View python_mysql.py
import mysql.connector
from mysql.connector import errorcode
config = {
'user': 'root',
'password': '',
'host': 'localhost',
'database': 'acme'
}