This repository is tailored for my personal use, but I want to make it public because I hope this repo will serve as a useful reference for all who come hither.
That said, I will probably exclude things that I already know to heart, such as Vim and Eclipse bindings.
- Confluence
- Doxygen
- Eclipse
- Emacs
- Excel
- Fedora
- GDB
- Git
- IntelliJ IDEA
- Linux
- Netcat
- Connect to an address and port
- OpenSSL
- Outlook
- Python
- Qt Creator Cheat Sheet
- Regex
- PyTest
- Sublime
- Vim
- Command mode
- Insertion Mode
- Normal Mode
- Find all matches of word under cursor
- Jump to line number
- Movement
- Center page around cursor
- Change/delete next instance of enclosed characters within double quotation marks
- Change/delete next instance of enclosed characters within single quotation marks
- Move cursor to the next instance of 'a'
- Move cursor to right before the next instance of 'a'
- Move cursor to the previous instance of 'a'
- Move cursor to right after the previous instance of 'a'
- Move to next match
- Skip to previous blank line
- Skip to next blank line
- Visual Mode
- Plugins
- Visual Studio Code
- Windows
- XmlLint
- YouTube
CTRL + SHIFT + 8
CTRL + ALT + 0
CTRL + K
CTRL + SHIFT + 7
doxygen -g
- Edit the newly generated Doxyfile to set the
RECURSIVE
tag toYES
. - To show private members, set
EXTRACT_PRIVATE
toYES
. doxygen Doxyfile
- Open up
html/index.html
.
@file
and@brief
matters in the top-level comment at the start of the file.@brief
does not matter in classes and functions.- A doxygen comment is required at the top of a namespace to generate doxygen for the members within.
- A doxygen comment is not required at the top of a class.
- Add
const
to the end of@copydoc
ifconst
is part of the method signature. @param[in]
does matter.@param [in]
also works.@throw
and@throws
both work. Be sure to specify the exception, e.g.,@throw RuntimeError upon ...
.
CTRL + d
ESC + d
CTRL + a
ESC + b
CTRL + e
ESC + f
ALT + H + D + S
ALT + H + O + R
sudo dnf remove blah
sudo dnf autoremove
sudo dnf clean packages
- Check for leftover configuration files within these folders:
/etc
/usr/share
~/.local
~/.config
Command-line:
ulimit -c unlimited
grep -lr '<<<<<<<' . | xargs git checkout --ours
grep -lr '<<<<<<<' . | xargs git checkout --theirs
git checkout -b new-branch old-branch
git checkout -b new branch
git push --delete origin branch-name
git checkout local-branch-name -- local-file.txt
git checkout origin/upstream-branch-name -- upstream-file.txt
git cherry-pick commit-number-from-other-branch
git reflog
-
git reflog
-
git cherry-pick local-commit-number
-
Merge the changes
-
git cherry-pick continue
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
git reset --hard commit-number
git reset --soft commit-number
git reset --mixed commit-number
git pull
git reset --hard origin/branch-name
git clean -fdn
f
is forced
is directoryn
is to preview changes (remove then
flag to actually clean)x
is to remove ignored files
CTRL + F4
CTRL + X
CTRL + N
CTRL + SHIFT + N
CTRL + SHIFT + F
ALT + F7
CTRL + ALT + Left Arrow
Any of these keys will work:
CTRL + Left Click
CTRL + ALT + B
CTRL + ALT + S
ALT + Left
ALT + Right
find ./ -name filename.txt
-iname
can be used for case insensitivity
ls -rt *.txt | xargs grep -lr --include=\*.txt 'searchterm' ./
env | grep ENV_VAR_NAME
ls -lta
tar -cvf sample.tar file1 file2
tar -czvf sample.tgz file1 file2
tar -tvf file.tgz
-t
is shorthand for--test
tar -xvf file.tar
-xvf
is shorthand for--extract --verbose --file
tar -C target-directory file.tgz
-C
changes to the target directory before extracting the tar file
.tar
is the conventional file extension to indicate the tarball is storing uncompressed data..tgz
,.tar.gz
, and.gz
are the conventional file extensions indicating the tarball is storing compressed data.
zip sample.zip file1 file2
zip -r sample.zip dir1/ dir2/
unzip file.zip
unzip -d target-directory file.zip
nc -vv address port
nc -vlp port
openssl genrsa -out private_key.key 1024
openssl rsa -in /dev/shm/key/private_key.key -out public_key.key -pubout -outform PEM
openssl dgst -sha224 -sign /dev/shm/key/private_key.key -out sample.digest sample.tgz
openssl dgst -sha224 -verify /dev/shm/key/public_key.key -signature sample.digest sample.tgz
* + <space>
CTRL + K
# Python 3.5+
p = subprocess.run(fullCmdStr,
shell=True,
check=False,
executable='/bin/bash')
executable
defaults tosh
instead ofbash
.check
throws an exception if the command failed.
p.returncode
is set to 0 if the command completed successfully.
F2
CTRL + L
CTRL + K
F4
Syntax | Description |
---|---|
a | Match 'a' |
\. | Match '.' |
. | Match any single character except newline |
Character Class | Description |
[0-9] | Digits within this range |
\d | Digits 0 through 9 |
\D | Non-digits |
[aeiou] | Match one of the given characters |
[^aeiou] | Match any other character that is not given |
[a-zA-Z] | Letter within this range (a-ZA-Z or A-Za-z) |
\s | Whitespace [\r\n\t\f] |
\S | Non-whitespace |
\w | Word [a-z, A-Z, 0-9, underscores] |
\W | Non-word |
Quantifier | Description |
[xy]{5} | Match a string of length 5 consisting of characters {x,y} |
f{1,3} | Match 'f' 1, 2, or 3 times |
\d{4,} | Match at least 4 digit characters |
c* | Match 'c' 0 or more times |
t+ | Match 't' 1 or more times |
Operator | Description |
[a|b] | Match 'a' or 'b' |
([A-Z]|[0-9]){2} | Apply quantifier to grouping of [A-Z] or [0-9] |
Anchor | Description |
^ | Beginning of string |
$ | End of string |
Grouping and Capturing | Description |
r'\b' | Word boundary special character (r is needed in Python to avoid confusion with the backspace character) |
() | Capture a group |
? | Optionally capture this group |
\1 | Matches the same text as previously matched by the first capturing group |
(?|regex1|regex2) | Known as a 'branch reset group' that matches one of these groups or nothing |
(\2two | (one))+ |
Lookahead | Description |
a(?!b) | Negative lookahead to notate that 'a' cannot be followed by 'b' |
a(?=b) | Positive lookahead to notate that 'a' must be followed by 'b' |
(?<=a)b | Positive lookbehind to notate that 'a' must precede 'b' |
(?<!a)b | Negative lookbehind to notate that 'a' cannot precede 'b' |
(b?)o\1
- Successfully matches 'o' because the backreference matches the nothing captured by the group
(b)?o\1
- In most regex flavors (excluding JavaScript), this regex pattern fails to match 'o' because the backreference references a group that did not participate in the match at all
Add a loop inside the main.
CTRL + SHIFT + P
CTRL + SHIFT + K
ALT + Q
CTRL + ALT + D
CTRL + ALT + T
" Determine the current file format
:set ff?
" If the current file format is DOS, change the file format to Unix
:set ff=unix
:%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
:%s/\t/ /g
:retab
" Jump to line 25
:25
a
i
A
I
*
" Jump to line 25
25G
zz
ci"
di"
ci'
di'
fa
ta
Fa
Ta
;
{
}
v
V
CTRL + v
OR CTRL + q
It should be noted that I rarely use Visual Studio Code these days.
- Bookmarks
- Bracket Pair Colorizer 2
- C/C++
- CMake
- CMake Tools
- CSS Peek
- Cython
- Material Icon Theme
- PlantUML
- Python
- Remote - WSL
- Trailing Spaces
- Currently, for a reason that I've long forgotten, I am not using this extension.
CTRL + ALT + -
F12
F11
Note that the setup below is still not as preferable as using the original Vim.
- Vim plugin installation
- Vim Plug
- https://github.com/neoclide/coc.nvim
ctrl+space
autocompletiongd
goto definitionctrl+o
to go backF2
renameK
show tooltip- additional features
- autoimport
- syntax errors
:CocInstall coc-snippets
to install extensions- coc-snippets
:CocCommand snippets.editSnippets
- coc-pairs
- coc-prettier
- autoformat on save
- coc-snippets
- https://github.com/preservim/nerdtree
ctrl+n
toggle file tree
- https://github.com/Xuyuanp/nerdtree-git-plugin
- icons for file tree git status
- https://github.com/tiagofumo/vim-nerdtree-syntax-highlight
- https://github.com/ryanoasis/vim-devicons
- icons for file tree file extensions
- https://github.com/airblade/vim-gitgutter
- color code modified lines
]c
jump to next modified line
- https://github.com/ctrlpvim/ctrlp.vim
ctrl+p
fuzzy find files
- https://github.com/preservim/nerdcommenter
ctrl+/
comment out code
- https://github.com/christoomey/vim-tmux-navigator
ctrl+l
switch to right panectrl+h
switch to left pane
- https://github.com/morhetz/gruvbox
- VS Code theme
- Click on the application to gain focus
- If you are confident that you have focus:
- To close the application, press
ALT + F4
. - To minimize the application, press
n
.
- To close the application, press
- Otherwise, press
ALT + SPACE
to bring up the context menu.
xmllint --format old_file.xml > new_file.xml
xmllint --noout --schema schema.xsd file.xml
Bring up the browser console (F12 on Chrome), and inject:
for(element of document.getElementsByClassName('ytp-ce-element')) { element.style.display = 'none'; }