Razet

Razet @razet

462
0
13
10

Answers

We utilize jQuery's is() method to check the selected element with another element, selector, or any jQuery object. This method traverses along the DOM elements to find a match, (...)

.gitignore will not allow untracked files from being added (without an add -f) to files tracked by git. However, git will continue to track any files that are already being tracked.

To (...)

In ECMAScript 6 has String.prototype.includes:

const string = "foo";
const substring = "oo";

console.log(string.includes(substring));

Old browsers do not support includes. (...)

Find the index of the array element you need to delete using indexOf, and afterward delete that index with splice.

const array = [2, 5, 9];

console.log(array);

const
 (...)

Redirect individual files

Redirect 301 /oldfile.htm /newfile.htm

To redirect one specific file to another domain such as example.com/oldfile.htm to example.net/newfile.htm:

Redirect
 (...)
Razet

Rename the current branch:

git branch -m <newname>

Rename a branch while pointed to any branch:

git branch -m <oldname> <newname>

The easy way to remember (...)

You can use the hidden selector:

// Matches all elements that are hidden
$('element:hidden')

And the [visible](http://docs.jquery.com/Selectors/visible (...)

Deleting a remote branch

git push origin --delete <branch>  # Git version 1.7.0 or newer
git push origin -d <branch>        # Shorter version (Git 1.7.0 or newer)
git
 (...)

git fetch only downloads new data from a remote repository - yet it doesn't integrate any of this new data into your working files. Fetch is incredible for getting a fresh view (...)

You can use -d with if condition to check if a directory exists or not:

if [ -d $DIRECTORY ]; then
  # $DIRECTORY exists.
fi

Make sure to wrap factors by double-quotes (...)