\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Krystian} \pdfinfo{ /Title (for-my-sweetheart.pdf) /Creator (Cheatography) /Author (Krystian) /Subject (for my sweetheart Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{1FC4ED} \definecolor{LightBackground}{HTML}{F1FBFD} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{for my sweetheart Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Krystian} via \textcolor{DarkBackground}{\uline{cheatography.com/144870/cs/31140/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Krystian \\ \uline{cheatography.com/krystian} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 12th March, 2022.\\ Updated 20th March, 2022.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{3.2 cm} x{4.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Text Editing}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Ctrl + left/right}} & Jump a word \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Home/End}} & Jump to the beginning/end of line/website \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Ctrl + Home/End}} & Jump to the beginning/end of the file \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{Ctrl + X}} & When u have nothing selected, its gonna cut the line your cursor is currently on, can be used to remove lines \tn % Row Count 11 (+ 5) % Row 4 \SetRowColor{LightBackground} {\bf{Ctrl + backspace/delete}} & Remove the word to the left/right of your cursor \tn % Row Count 13 (+ 2) % Row 5 \SetRowColor{white} {\bf{Win + V}} & Multiclipboard \tn % Row Count 14 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{When u hold shift with some of them youre gonna select the text your cursor has to pass through, for ex.{\bf{Ctrl + shift + end}} is gonna select everything from where your cursor is all the way to the end of the file.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.8 cm} x{5.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Google Chrome}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Ctrl + Tab }} & Switch chrome tabs \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Ctrl + Shift + Tab}} & Switch tabs in the opposite direction \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Ctrl + T}} & Open new browser tab \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} {\bf{Ctrl + W}} & Close browser tab \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{Ctrl + L}} & Move cursor to address bar \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} {\bf{Alt + left/right}} & Go back/forward \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{/}} & When on google or on youtube u can use it to place your cursor in the search bar \tn % Row Count 13 (+ 4) % Row 7 \SetRowColor{white} {\bf{Ctrl + N}} & New browser window({\bf{not tab}}, window) \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{Ctrl + Shift + N}} & New incognito window \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} {\bf{Ctrl + I}} & Inspect website html code \tn % Row Count 18 (+ 1) % Row 10 \SetRowColor{LightBackground} {\bf{Ctrl + 1,2,3...}} & Jump to 1,2,3... tab \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Git}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{git init}} & Initialize git repository \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{git status}} & Show changes made in project and contents of staging area \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{git add \textless{}file\_name or .\textgreater{}}} & Add file or all contents of a directory(using dot) to staging area \tn % Row Count 9 (+ 4) % Row 3 \SetRowColor{white} {\bf{git commit -m "message"}} & Commit staged changes \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{git reset -{}-hard}} & Reset changes to last commit on the branch \tn % Row Count 14 (+ 3) % Row 5 \SetRowColor{white} {\bf{git branch -{}-show-current}} & Show what branch you are on \tn % Row Count 16 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{git branch -a}} & Show all branches in the repository \tn % Row Count 18 (+ 2) % Row 7 \SetRowColor{white} {\bf{git checkout -b \textless{}branch\_name\textgreater{}}} & Create a new branch \tn % Row Count 20 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{git checkout \textless{}branch\_name\textgreater{}}} & Switch to another branch \tn % Row Count 22 (+ 2) % Row 9 \SetRowColor{white} {\bf{git merge \textless{}branch\_name\textgreater{}}} & Merge branch to the branch you're currently on \tn % Row Count 25 (+ 3) % Row 10 \SetRowColor{LightBackground} {\bf{git checkout -{}- \textless{}filename or .\textgreater{}}} & Discard unstaged changes in chosen file \tn % Row Count 27 (+ 2) % Row 11 \SetRowColor{white} {\bf{git remote add \textless{}alias\textgreater{} \textless{}url\textgreater{}}} & Associate given url(link) to an alias \tn % Row Count 29 (+ 2) % Row 12 \SetRowColor{LightBackground} {\bf{git remote -v}} & Print all added remotes \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Git (cont)}} \tn % Row 13 \SetRowColor{LightBackground} {\bf{git push \textless{}remote\textgreater{} \textless{}local\_branch:remote\_branch\textgreater{}}} & Push a branch to remote repository(-u flag to save settings) \tn % Row Count 3 (+ 3) % Row 14 \SetRowColor{white} {\bf{git pull \textless{}remote\textgreater{} \textless{}remote\_branch:local\_branch\textgreater{}}} & Pulls a branch from remote repository \tn % Row Count 6 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\textless{}remote\textgreater{} is one of the aliases added by git remote add \newline git pull = git fetch + git merge} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{MySql}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{mysqld -{}-console}} & Starts mysql service \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{mysql -u \textless{}username\textgreater{}}} & Login to mysql shell \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{INSIDE SHELL}}} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{SHOW DATABASES;}} & Shows databases \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{USE \textless{}database\_name\textgreater{};}} & Chooses database to execute queries on \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} {\bf{SHOW TABLES;}} & Shows tables from chosen database \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{DESCRIBE \textless{}table\_name\textgreater{};}} & Shows information about a table \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} {\bf{CREATE TABLE \textless{}table\_name\textgreater{} (\{\{nl\}\}~ \textless{}column\_name\textgreater{} \textless{}column\_type\textgreater{} \textless{}extra\_params\textgreater{},\{\{nl\}\}~ ... \{\{nl\}\});}} & Creates a table \tn % Row Count 17 (+ 6) % Row 8 \SetRowColor{LightBackground} {\bf{~\{\{fa-angle-double-right\}\}AUTO\_INCREMENT}} & Automatically increments its value with each added row \tn % Row Count 20 (+ 3) % Row 9 \SetRowColor{white} {\bf{~\{\{fa-angle-double-right\}\}PRIMARY KEY}} & It's gonna be a primary key for that table \tn % Row Count 23 (+ 3) % Row 10 \SetRowColor{LightBackground} {\bf{~\{\{fa-angle-double-right\}\}NULL / NOT NULL}} & Whether the column can be NULL or not \tn % Row Count 26 (+ 3) % Row 11 \SetRowColor{white} {\bf{~\{\{fa-angle-double-right\}\}DEFAULT \textless{}value\textgreater{}}} & Default value the column will be initialized with when adding a row \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{MySql (cont)}} \tn % Row 12 \SetRowColor{LightBackground} {\bf{SELECT \textless{}column1\textgreater{},\textless{}column2\textgreater{}... FROM \textless{}table\_name\textgreater{};}} & Select particular columns from a table \tn % Row Count 3 (+ 3) % Row 13 \SetRowColor{white} {\bf{~\{\{fa-angle-double-right\}\}SELECT * ...}} & Select all columns from a table \tn % Row Count 6 (+ 3) % Row 14 \SetRowColor{LightBackground} {\bf{~\{\{fa-angle-double-right\}\}LIMIT \textless{}amount\textgreater{}}} & Selects \textless{}amount\textgreater{} latest rows \tn % Row Count 9 (+ 3) % Row 15 \SetRowColor{white} {\bf{~\{\{fa-angle-double-right\}\}LIMIT \textless{}starting\_id\textgreater{},\textless{}amount\textgreater{}}} & Select \textless{}amount\textgreater{} rows starting from the row with id=\textless{}starting\_id\textgreater{} \tn % Row Count 13 (+ 4) % Row 16 \SetRowColor{LightBackground} {\bf{~\{\{fa-angle-double-right\}\}WHERE \textless{}column\textgreater{}=\textless{}value\textgreater{}}} & Select all rows whose \textless{}column\textgreater{} is equal to \textless{}value\textgreater{} \tn % Row Count 16 (+ 3) % Row 17 \SetRowColor{white} {\bf{INSERT INTO \textless{}table\_name\textgreater{} (\textless{}column1\textgreater{},\textless{}column2\textgreater{}, ...) VALUES (\textless{}value1\textgreater{},\textless{}value2\textgreater{},...);}} & Insert values into a table \tn % Row Count 21 (+ 5) % Row 18 \SetRowColor{LightBackground} {\bf{TRUNCATE \textless{}table\_name\textgreater{};}} & Clear a table \tn % Row Count 23 (+ 2) % Row 19 \SetRowColor{white} {\bf{DROP \textless{}table\_name\textgreater{};}} & Remove a table \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{root - your database username, root is like admin} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.12 cm} x{4.88 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Pycharm}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Ctrl + Shift + up/down}} & Move selected text up/down \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Ctrl + /}} & Comment selected text out \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Alt + 4 }} & Jump to run window \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} {\bf{Ctrl + F12}} & Jump to terminal window \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{Ctrl + F8}} & Toggle breakpoint \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} {\bf{Shift + F10}} & Run the program in normal mode \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{Ctrl + Shift + F10}} & Run the program whose window I have currently open \tn % Row Count 12 (+ 3) % Row 7 \SetRowColor{white} {\bf{Shift + F9}} & Run the program in debug mode \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{IN DEBUG}}} \tn % Row Count 15 (+ 1) % Row 9 \SetRowColor{white} {\bf{F7}} & Step into a function \tn % Row Count 16 (+ 1) % Row 10 \SetRowColor{LightBackground} {\bf{F8}} & Step over \tn % Row Count 17 (+ 1) % Row 11 \SetRowColor{white} {\bf{F9}} & Resume program \tn % Row Count 18 (+ 1) % Row 12 \SetRowColor{LightBackground} {\bf{Ctrl + F2}} & Stop running program \tn % Row Count 19 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.12 cm} x{4.88 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Command Prompt/Terminal}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{pwd}} & Print working directory \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{cd \textless{}folder\_name\textgreater{}}} & Change directory \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{cd ..}} & Go to parent folder \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{ls}} & List contents of current directory \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{Windows:}}} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} {\bf{dir}} & List contents of current directory \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{dir /a}} & List contents of current directory including hidden files \tn % Row Count 12 (+ 3) % Row 7 \SetRowColor{white} {\bf{cd}} & Print working directory(cd without anything after) \tn % Row Count 15 (+ 3) % Row 8 \SetRowColor{LightBackground} {\bf{rd \textless{}directory\_name\textgreater{} /s}} & Removes a directory with all its contents \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} {\bf{mkdir \textless{}name\textgreater{}}} & Creates a new directory \tn % Row Count 19 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}