Cheat Sheets
Star
Fork
Follow @spences10
Search:
Alfred
Add custom search
Change the default search in Alfred
Bash
Human Readable $PATH output
Change default shell
Kill process on port
Add an alias
Sort alphabetically
See file permissions
Open the SSH agent each time you open a new terminal.
Search Bash history
Remove command from bash history
Move the contents of a folder to another folder
CSS
Center anything, horizontally and vertically, with 3 lines of CSS:
Vertically center with margin
Vertically center with absolute positioning
Vertically center with flexbox
Vertically center with grid
Breaking Long Words and URLs
Chocolatey
List locally installed packages
Update all installed Chocolatey packages
Fish Shell
NVM not recognised in Fish?
Aliases
Oh My Fish
Use nvm with fish
List out added aliases
Git
Use a git patch file
Change the git init default branch name
Add a repo from your machine to GitHub
Latest changes from repo to your machine
Add tracking information to your work
What branch
Create a local branch and push it to GitHub
Create a PR Pull Request
Check remotes
Sync a remote fork on your machine
Sync a remote fork on Github
2fa
Change origin url
Add code on your machine to new repo
Delete branches
Merge master branch into feature branch
Merge two repos
Stop tracking a file
Stop tracking a previously tracked folder
Start tracking a previously un-tracked file
Cloning a repo from someone else's GitHub and pushing it to a repo on my GitHub
Remove an upstream repository
Clone a repo and give it a different name
Using Husky?
How to read last commit comment?
Remove commit from pull request
Show .gitconfig details
Conflicts between Windows Git and WSL Git?
If you want to rename a branch while pointed to any branch, do:
Git ref log
Use SSH in place of HTTPS
How to authenticate with GitHub using SSH
Use multiple SSH keys
Re-use SSH keys, from one machine to another
Using SSH over the HTTPS port
Change SSH key password
Specify multiple users for myself in .gitconfig?
Cant remember what your last git commit said?
Rebase changes
Rebase accept incoming in bulk
See differences between two branches
See differences between two files
Revert to a previous commit
Gitignore
Homebrew
Search homebrew
Install
Install multiple items in one command
Check for and install updates
Cask upgrade
Hyperterm
use Git bash
JavaScript
Document Design Mode
Copy an array
Combine two arrays
Remove item without mutating
Reverse an array
Reverse a string
New array from existing
Return new array filter
Return one new thing only
Sum all even numbers from array
Return the first duplicate number
Async await with axios and GraphQL
Remove vowels from string
Closure examples
Mock and endpoint
List all image URLs from a web page
<div> cannot appear as a descendant of <p>
Truncate a string
Current year one liner
Fizz Buzz
Prototypal Instantiation
Change Page Font Size
Linux
Install a binary
Get build info
Get kernel version
Get architecture
See what Linux version
force uninstall a package
see what services are available
see what services are running
Node Version Manager (nvm)
Install specific node version
Switch node versions
Default node version
VS Code
Show Key presses
Want to list out what extensions you have installed?
Want to have your own keyboard shortcut?
Remove the clutter
Vim
Exit Vim
Windows Subsystem Linux (WSL)
Shutdown WSL
Change WSL Version
Set the default version of WSL
List installed WSL Distros
Yarn
Yarn global binaries not showing
Update dependencies
Globally add a package
Upgrade global packages
displays the location of the yarn bin folder.
list installed packages.
create-react-app
flow
npm ci
ZSH
Human Readable $PATH output
Node not working in zsh?
Clone plugin into correct location
Use nvm with zsh
include aliases
oh my zsh
macOS
Install Git without xcode
Screen snip
Screenshot
Screenshot, record screen UI
Keys
System
Enable "Allow apps downloaded from:"
now
Add a TXT record
Add a CNAME
Aliases
Scale your deployment
Environment variables
npm
install package.json dependencies
List globally installed packages.
list available scripts to run
update npm
flags
installed version
Uninstall global package
Upgrade NPM on Windows
Updating global packages
dont rm -rf node_modules; npm install
Bump version number
npx
update all project dependencies
browsers list
styled components
conditionally use a style