Skip to content

Instantly share code, notes, and snippets.

View mwj8410's full-sized avatar

Matthew Jackson mwj8410

  • Detroit, Michigan
View GitHub Profile
@mwj8410
mwj8410 / Docker.md
Last active November 14, 2017 17:16
Local Dev Configuration

Docker

Tool to clean up VM space brew install docker-clean

docker-clean run

Alternatively, don't do that at all and run: docker images | awk '{if(NR>1) print $3}' | xargs docker rmi -f

@mwj8410
mwj8410 / one_liners.md
Last active November 10, 2017 22:16
Useful One Line JS operations

Create and array of N size where prefilled with index

Array.from(Array(N).keys());

Working off the previous, makes an onject from that array

Array.from(new Array(24).keys()).reduce((acc, cur, i) => {
  acc[i] = cur
 return acc

This assumes that this is a simple merge conflict where the same files are changed in both branches

This is most common when using merge commits in the working branch and attempting to rebase that branch into a target branch. The solution is to either do a merge commit into the target branch, or to reqrite the history of the working copy as follows:

git checkout development
git pull
git checkout <feature branch>
git pull
git rev-list --count HEAD ^development    // Provides the  number of commits in the branch not in development
@mwj8410
mwj8410 / Common Regular Expressions.md
Last active July 27, 2018 14:59
Common Regular Expressions

Common Regular Expression

Password Validation

/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])^\S{6,20}$/

  • Contians a digit
  • Contains a lowercase letter
  • Contains an upper case letter
  • is between 6 and 20 non-whitespace characters in length