diff --git a/docusaurus.config.js b/docusaurus.config.js index 585f71a..12ef722 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -171,14 +171,17 @@ const config = { }, { label: "Git Cheat Sheet", - // Use 'href' for static assets and add the leading slash - href: "/downloads/cheatsheet.jpg", - target: "_blank", + href: "pathname:///fynes-forge-git-cheatsheet.pdf", + attributes: { + download: true, + }, }, { label: "SQL Cheat Sheet", - href: "/downloads/sql_cheatsheet.jpg", - target: "_blank", + href: "pathname:///fynes-forge-sql-cheatsheet.pdf", + attributes: { + download: true, + }, }, ], }, diff --git a/static/fynes-forge-git-cheatsheet.pdf b/static/fynes-forge-git-cheatsheet.pdf new file mode 100644 index 0000000..2a5346b Binary files /dev/null and b/static/fynes-forge-git-cheatsheet.pdf differ diff --git a/static/fynes-forge-git-cheatsheet.svg b/static/fynes-forge-git-cheatsheet.svg new file mode 100644 index 0000000..fe12f77 --- /dev/null +++ b/static/fynes-forge-git-cheatsheet.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FYNES + FORGE + + + + GIT + CHEAT SHEET + + + + + + BASIC COMMANDS + + + + + + + git init + Initializes a new Git repository in the current directory. + + + + + + git clone [url] + Creates a local copy of a remote repository. + + + + + + git status + Displays the status of your working directory and staging area. + + + + + + git add [file] + Adds a specific file to the staging area. + + + + + + git add . + Stages all changes (new and modified files) in the current dir. + + + + + + git commit -m "message" + Records staged changes with a descriptive message. + + + + + + git log + Shows the commit history. + + + + + + git diff + Shows changes between commits, commit and working tree, etc. + + + BRANCHING & MERGING + + + + + + git branch + Lists all local branches. + + + + + git branch [branch-name] + Creates a new branch. + + + + + git checkout [branch] + Switches to a different branch. + + + + + git merge [branch-name] + Integrates changes from a specified branch into current branch. + + + + + git branch -d [branch] + Deletes a specified branch (only if merged). + + + + + git push -u origin [branch] + Pushes a new branch to remote and sets it upstream. + + + REMOTE OPERATIONS + + + + + + git pull + Fetches and integrates changes from remote to current branch. + + + + + git push + Uploads local branch commits to the remote repository. + + + + + git remote add origin [url] + Adds a new remote repository. + + + + + git remote -v + Lists all configured remote repositories. + + + UNDOING CHANGES + + + + + + git restore [file] + Unstages changes for a specific file. + + + + + git restore . + Discards all unstaged changes in the working directory. + + + + + git revert [commit] + Undoes a commit by creating a new reverting commit. + + + + + git reset --hard [commit] + Resets branch to a specific commit, discarding all subsequent. + + + STASHING + + + + + + git stash + Temporarily saves changes that are not ready to be committed. + + + + + git stash pop + Reapplies the most recently stashed changes. + + + + + git stash list + Shows a list of all stashed changes. + + + + + git stash drop + Deletes the most recent stash. + + + + + + + + + + + + + + + + FYNES FORGE · GIT CHEAT SHEET + Created by Tom Fynes · fynes-forge + diff --git a/static/fynes-forge-sql-cheatsheet.pdf b/static/fynes-forge-sql-cheatsheet.pdf new file mode 100644 index 0000000..970ae2e Binary files /dev/null and b/static/fynes-forge-sql-cheatsheet.pdf differ diff --git a/static/fynes-forge-sql-cheatsheet.svg b/static/fynes-forge-sql-cheatsheet.svg new file mode 100644 index 0000000..1d89f03 --- /dev/null +++ b/static/fynes-forge-sql-cheatsheet.svg @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FYNES + FORGE + + + + + + SQL + CHEAT SHEET + + + + + + DATA QUERY LANGUAGE (DQL) + + + + + + + + SELECT col1, col2 FROM table_name + Retrieves data from one or more columns in a table. + + + + + + SELECT * FROM table_name + Retrieves all columns from a table. + + + + + + SELECT DISTINCT col FROM table + Retrieves unique values from a specified column. + + + + + SELECT * FROM t WHERE condition + Filters records based on a specified condition. + + + + + + SELECT * FROM t ORDER BY col ASC + Sorts the result set in ascending or descending order. + + + + + SELECT COUNT(col) FROM table + Returns the number of rows matching a criterion. + + + + + + SELECT SUM(col) FROM table + Calculates the sum of a numeric column. + + + + + SELECT AVG(col) FROM table + Calculates the average value of a numeric column. + + + + + + SELECT MIN(col) FROM table + Returns the smallest value of the selected column. + + + + + SELECT MAX(col) FROM table + Returns the largest value of the selected column. + + + + + + SELECT col FROM t GROUP BY col + HAVING condition + Groups rows with same values; filtered by HAVING. + + + + + SELECT * FROM t LIMIT n + Limits number of records returned. (Syntax varies by DB) + + + DATA DEFINITION LANGUAGE (DDL) + + + + + + + CREATE DATABASE db_name + Creates a new SQL database. + + + + + CREATE TABLE t (col1 type, ...) + Creates a new table in a database. + + + + + + ALTER TABLE t ADD col type + Adds a new column to an existing table. + + + + + ALTER TABLE t DROP COLUMN col + Deletes a column from an existing table. + + + + + + DROP TABLE table_name + Deletes an existing table. + + + + + DROP DATABASE db_name + Deletes an existing database. + + + DATA MANIPULATION LANGUAGE (DML) + + + + + + + INSERT INTO t (c1, c2) + VALUES (val1, val2) + Inserts new records into a table. + + + + + UPDATE t SET col = val + WHERE condition + Modifies existing records in a table. + + + + + + DELETE FROM t WHERE cond + Deletes existing records from a table. + + + JOINS + + + + + + + INNER JOIN + Returns records matching values in both tables. + + + + + LEFT JOIN (LEFT OUTER JOIN) + All left table rows + matched right table rows. + + + + + + RIGHT JOIN (RIGHT OUTER JOIN) + All right table rows + matched left table rows. + + + + + FULL JOIN (FULL OUTER JOIN) + Returns all records when there is a match in either table. + + + + + + SELECT Orders.OrderID, Customers.CustomerName FROM Orders + INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID + Example of an INNER JOIN. + + + + + + + + + + + + + + + + + + FYNES FORGE · SQL CHEAT SHEET + Created by Tom Fynes · fynes-forge +