Select #id with word as prefix and counter as suffix

<a id="my-favourite1"/ class="added">
<a id="my-favourite2"/ class="add">
<a id="my-favourite3"/ class="add">
<a id="my-favourite4"/ class="added">
<a id="my-favourite5"/ class="added">
<script type="text/javascript">
 
            $('a[id^=my-favourite]').on('click', function (e) {
                console.log('Clicked');
                console.log(this.id);
                console.(this.id.removeClass('added').addClass('add'));
                }
            );
</script>

CSS Rounded Corners

#rcorners1 {
    border-radius: 25px;
}

Getting “Blocked loading mixed active content” issue in Firefox

Avoid using “http://” or “https://” when loading the script in html, css or javascript.
The correct example is this:

 
<script type="text/javascript">
 
$.getScript("//maps.googleapis.com/maps/api/js?key=somekey");
 
</script>

Method chaining to split logic into a chain-look to make more understandable pieces of code

class MyCar {
	function setPedals() {
	// code logic
	return this;
	}
 
	function setWheels() {
	// code logic
	return this;
	}
 
	function setEngine() {
	// code logic
	}
}
 
$myCar = new MyCar();
$myCar.setPedals().setWheels().setEngine();

This pattern also called Fluent Interface. More information can be found here:
Method chaining
Fluent interface

Detecting browser and protocol in Javascript

<script type="text/javascript">
 
    if(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && location.protocol=='http:') {
        alert('Using current position in chrome restricted under http protocol')
    }
    else if (/msie/.test(navigator.userAgent.toLowerCase())) {
        console.log("This browser is MSIE");
    }
    else if (/firefox/.test(navigator.userAgent.toLowerCase())) {
        console.log("This browser is Firefox");
    }
 
</script>

div containers position

Main keywords which controls div contrainers position: float: left; and clear: left;
Size by side example:

1
2

One on top of other example:

1
2

Remove untracked files

git clean -fd

Remove untracked file

git reset

Phpunit Mock vs Stub

Моcк — имитация объекта
Stub — заглушка для метода

Git using subtree

1. Adding subtree to current project

git remote add mysubproject git@github.com:iaghayev/mysubproject.git
 
git subtree add --prefix=path/to/somedir mysubproject master

2. Committing changes to subproject from path/to/somedir folder

git subtree push --prefix=path/to/somedir mysubproject master

3. Getting latest code changes from subproject

git subtree pull --prefix=path/to/somedir mysubproject master