\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{hjkatzneadwerx} \pdfinfo{ /Title (nead-werx-standard-profile.pdf) /Creator (Cheatography) /Author (hjkatzneadwerx) /Subject (Nead Werx Standard Profile 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}{00274C} \definecolor{LightBackground}{HTML}{F7F8F9} \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{Nead Werx Standard Profile Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{hjkatzneadwerx} via \textcolor{DarkBackground}{\uline{cheatography.com/23551/cs/5226/}}} \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}hjkatzneadwerx \\ \uline{cheatography.com/hjkatzneadwerx} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 21st September, 2015.\\ Updated 13th May, 2016.\\ 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.12 cm} x{4.88 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Bash Functions}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\}Function & Use \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \{\{nobreak\}\}`vack \textless{}regex\textgreater{}` & Find all files that do contain a specific regex pattern, and open them in vim. \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\}`vnack \textless{}regex\textgreater{}` & Find all files that do not contain a specific regex pattern, and open them in vim. \tn % Row Count 10 (+ 4) % Row 3 \SetRowColor{white} \{\{nobreak\}\}`taila \textless{}glob\textgreater{}` & Tail the access log of sites starting with a glob. \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} \{\{nobreak\}\}`taile \textless{}glob\textgreater{}` & Tail the error log of sites starting with a glob. \tn % Row Count 16 (+ 3) % Row 5 \SetRowColor{white} \{\{nobreak\}\}`v \textless{}glob\textgreater{}` & Change to a vhosts directory starting with a glob. \tn % Row Count 19 (+ 3) % Row 6 \SetRowColor{LightBackground} \{\{nobreak\}\}`g` & The g script. \tn % Row Count 20 (+ 1) \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}{Standard Scripts}} \tn % Row 0 \SetRowColor{LightBackground} Script & Use \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \{\{nobreak\}\}`get\_supervisor\_email \textless{}name\textgreater{}` & Returns the email address of the supervisor for the given name. \tn % Row Count 5 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\}`git freeze \textless{}branch\textgreater{}` & Freezes an xERP branch in git, this includes tagging, changing JIRA, and deleting the branch. \tn % Row Count 10 (+ 5) % Row 3 \SetRowColor{white} \{\{nobreak\}\}`git merge-feature \textless{}branch\textgreater{}` & Merges an xERP feature branch into the current versioned branch, this includes tagging, changing JIRA, and deleting the branch. \tn % Row Count 17 (+ 7) % Row 4 \SetRowColor{LightBackground} \{\{nobreak\}\}`git report \textless{}object\textgreater{}` & Generates a report for a given commit, branch, or tag in a repo. \tn % Row Count 21 (+ 4) % Row 5 \SetRowColor{white} \{\{nobreak\}\}`git restore \textless{}regex\textgreater{}` & Finds and restores deleted or otherwise missing git files. \tn % Row Count 24 (+ 3) \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}{Vim Mappings}} \tn % Row 0 \SetRowColor{LightBackground} Key Combination & Use \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `\textless{}C-w\textgreater{}h`, `\textless{}C-w\textgreater{}j`,\{\{nl\}\}`\textless{}C-w\textgreater{}k`, `\textless{}C-w\textgreater{}l` & Move in split windows with `ctrl+hjkl` \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} `+`, `-` & Intuitive \seqsplit{increment/decrement.} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `:w!!` & Save a file that you accidentally opened up without sudo. \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} `\textless{}F12\textgreater{}` & Toggle pastemode. \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.68 cm} x{6.32 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Vim Plugins - Easy Align}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Delimiter} & Alignment \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `s` & Aligns sql statements by keyword. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `?` & Align on question mark. \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} `:` & Align on colon. \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} `{[}`, `{]}` & Align on close square bracket. \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} `(`, `)` & Align on close parenthesis. \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} `\{`, `\}` & Align on close curly brace. \tn % Row Count 9 (+ 1) % Row 7 \SetRowColor{white} ` ` & Align on space. \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} `,` & Align on comma. \tn % Row Count 11 (+ 1) % Row 9 \SetRowColor{white} `=` & Align on equal sign. \tn % Row Count 12 (+ 1) % Row 10 \SetRowColor{LightBackground} `\textless{}` & Align on left angle bracket. \tn % Row Count 13 (+ 1) % Row 11 \SetRowColor{white} `\textgreater{}` & Align on right angle bracket. \tn % Row Count 14 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{How to use: Select text using visual mode (`v`, `shift-v`, or `ctrl-v`), then press `\textless{}Enter\textgreater{}`. Now you have started easy align. Then press one of the delimiters defined above to align the text to that character. You can also specify a number before the delimiter to state which character to align on. Therefore the sequence `\textless{}Enter\textgreater{}3,` aligns on the third comma. Negatives work from the end. And `*` means align on all occurrences.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Vim Plugins - Ultisnips}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{How to use: In insert mode press `ctrl-t`, this brings up the ultisnip list. Then you can type or navigate through the list to find the snippet you want. You can also start by typing all or part of a snippet name before pressing `ctrl-t` to limit your search initially. Press `\textless{}Enter\textgreater{}` to select a snippet, then use `\textless{}Tab\textgreater{}` and `shift-\textless{}Tab\textgreater{}` to navigate through the snippet selection areas filling them out as you go.% Row Count 9 (+ 9) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.52 cm} x{4.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Zsh Functions}} \tn % Row 0 \SetRowColor{LightBackground} Function & Use \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \{\{nobreak\}\}`ack \textless{}regex\textgreater{}` & Search for text inside a directory matching the regex. \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\}`mdless \textless{}filepath\textgreater{}` & Process a markdown file through pandoc and open it in a pager. \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} \{\{nobreak\}\}`zsh\_stats` & Find out how much you use commands. \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \{\{nobreak\}\}`which\_alias \textless{}alias\textgreater{}` & Get the value of an alias. \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} \{\{nobreak\}\}`take \textless{}filepath\textgreater{}` & Make a directory and go to it all in one step. \tn % Row Count 14 (+ 3) % Row 6 \SetRowColor{LightBackground} \{\{nobreak\}\}`vack \textless{}regex\textgreater{}` & Find all files that do contain a specific regex pattern, and open them in vim. \tn % Row Count 18 (+ 4) % Row 7 \SetRowColor{white} \{\{nobreak\}\}`vnack \textless{}regex\textgreater{}` & Find all files that do not contain a specific regex pattern, and open them in vim. \tn % Row Count 22 (+ 4) % Row 8 \SetRowColor{LightBackground} \{\{nobreak\}\}`taila \textless{}glob\textgreater{}` & Tail the access log of sites starting with a glob. \tn % Row Count 25 (+ 3) % Row 9 \SetRowColor{white} \{\{nobreak\}\}`taile \textless{}glob\textgreater{}` & Tail the error log of sites starting with a glob. \tn % Row Count 28 (+ 3) % Row 10 \SetRowColor{LightBackground} \{\{nobreak\}\}`v \textless{}glob\textgreater{}` & Change to a vhosts directory starting with a glob. \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.52 cm} x{4.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Zsh Functions (cont)}} \tn % Row 11 \SetRowColor{LightBackground} \{\{nobreak\}\}`g` & The g script. \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.76 cm} x{6.24 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Zsh Aliases}} \tn % Row 0 \SetRowColor{LightBackground} Alias & Mapping \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `rm` & `rm -i` \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `mv` & `mv -i` \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `cp` & `cp -i` \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `ll` & `ls -alF` \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `la` & `ls -A` \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `l` & `ls` \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} `cl` & `clear \&\& ls ` \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} `..` & `cd ..` \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} `cd..` & `cd ..` \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} `cd...` & `cd ../..` (and so on...) \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} `md` & `mkdir -p` \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} `rd` & `rmdir` \tn % Row Count 13 (+ 1) % Row 13 \SetRowColor{white} `d` & `dirs -v | head 10` \tn % Row Count 14 (+ 1) % Row 14 \SetRowColor{LightBackground} `1` & `cd -` \tn % Row Count 15 (+ 1) % Row 15 \SetRowColor{white} `2` & `cd -2` \tn % Row Count 16 (+ 1) % Row 16 \SetRowColor{LightBackground} `3` & `cd -3` (and so on...) \tn % Row Count 17 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Vim Plugins - Endwise}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{How to use: In a shell like document this plugin automatically adds the closing `fi` or `endifs` and the like for you.% Row Count 3 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.6 cm} x{6.4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Vim Plugins - Fugitive}} \tn % Row 0 \SetRowColor{LightBackground} Command & Use \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \seqsplit{`:Gstatus`} & Bring up the current status in a buffer. \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{`:Gcommit`} & Starts the commit process in vim. \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{`:Gpush`} & Pushes the repo. \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \seqsplit{`:Gblame`} & Opens a blame window for the current file. \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{How to use: See \{\{link="https://github.com/tpope/vim-fugitive"\}\}vim-fugitive\{\{/link\}\} for details.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Vim Plugins - Supertab}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{How to use: Tab now autocompletes.% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.52 cm} x{6.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Vim Plugins - Syntastic}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Mapping} & Use \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `\textless{}F7\textgreater{}` & Start syntax and style checking. \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `\textless{}F8\textgreater{}` & Toggle syntax and style checking. \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} `\textless{}Home\textgreater{}` & Move up through the errors list. \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} `\textless{}End\textgreater{}` & Move down through the errors list. \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{How to use: When you're in a file press `\textless{}F7\textgreater{}` to start syntastic. Then navigate through the document and fix the errors/warnings. On each save the checkers will run again and show the output. You're goal should be to get a clean file with no output.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}