Skip to content

Instantly share code, notes, and snippets.

View perfettiful's full-sized avatar
🎯
Focusing

Nathan Perfetti perfettiful

🎯
Focusing
View GitHub Profile
@perfettiful
perfettiful / react-jsx-cheatsheet.md
Created January 23, 2023 23:59
React & JSX Cheatsheet

React & JSX Cheatsheet

Overview
JSX HTML <div>...</div>
JSX Component <Component property={javascript} />
<Component property='string' />
JSX Component with Children <Component>{children}</Component>
reference: props.children
Escaping JavaScript {...}
require statements const React = require('react');
const ReactDOM = require('react-dom');
npm modules react, react-dom
@perfettiful
perfettiful / troubleshoot.css
Last active August 30, 2022 16:36
CSS troubleshooting Wildcard style
* {
outline: 3px solid limegreen !important;
background: rgba(0, 151, 0, 0.1) !important;
}
@perfettiful
perfettiful / tutorial.md
Created April 15, 2022 00:16
Practice README Tutorial

Title (replace with your title)

Introductory paragraph (replace this with your text)

Summary

Briefly summarize the regex you will be describing and what you will explain. Include a code snippet of the regex. Replace this text with your summary.

Table of Contents

@perfettiful
perfettiful / regexCheatsheet.js
Last active April 14, 2022 20:36
Regex in JS Cheatsheet
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"

Print and pad 0 of number sequence

echo {01..15}

Iterate print command

 for p in {01..15}
  do
 echo $p
@perfettiful
perfettiful / git-cheatsheet.md
Created December 15, 2021 00:11
Comprehensive cheatsheet for Git/ Github

Git

Setup

See where Git is located: which git

Get the version of Git: git --version

Create an alias (shortcut) for git status:

@perfettiful
perfettiful / terminal-cheatsheet.txt
Last active August 24, 2022 00:48
Terminal Cheatsheet
man COMMAND # Look up help for the given command
pwd # Print working directory
cd MYDIR # Change directory to MYDIR
cd ~/ # Change directory to user root (/Users/USERNAME)
cd .. # Change directory up a level
mkdir NEWDIR # Create a new directory in the current folder called NEWDIR
cal # View Calendar in terminal
@perfettiful
perfettiful / gist:ec7e62af11730678c44a7180b9dc5d11
Created May 24, 2021 16:17
Node/Express extract Query params from Req
=========================
for (const key in req.query) {
console.log(key, req.query[key])
}
=========================
The query string is the part that comes after the URL path, and starts with a question mark ?.
https://qd63qcai7ta411io-4710885.shopifypreview.com
@perfettiful
perfettiful / deploy-django.md
Created January 6, 2021 00:43 — forked from rmiyazaki6499/deploy-django.md
Deploying a Production ready Django app on AWS

Deploying a Production ready Django app on AWS

In this tutorial, I will be going over to how to deploy a Django app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app Hygge Homes (a vacation home rental app for searching and booking vacation homes based off Airbnb) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
  • Continuous deployment with Github Actions/SSM Agent