Posted
on July 7, 2017, 3:50 pm,
by admin,
under
javascript.
<script type="text/javascript">
...
$parent = $('#yourobject').parent();
$child = $('#yourobject').children(':first');
...
</script> |
[Ctrl] + [Super] + [Space]
Super: on some keyboards it has Windows logo
Posted
on July 5, 2017, 8:18 am,
by admin,
under
linux.
$HOME/.config/monitors.xml
Example:
<monitors version="1">
<configuration>
<clone>no</clone>
<output name="eDP-1">
<vendor>BOE</vendor>
<product>0x0653</product>
<serial>0x00000000</serial>
<width>1920</width>
<height>1080</height>
<rate>60</rate>
<x>3840</x>
<y>0</y>
<rotation>normal</rotation>
<reflect_x>no</reflect_x>
<reflect_y>no</reflect_y>
<primary>no</primary>
</output>
<output name="DP-1">
<vendor>BNQ</vendor>
<product>0x8016</product>
<serial>0x00005445</serial>
<width>1920</width>
<height>1080</height>
<rate>60</rate>
<x>1920</x>
<y>0</y>
<rotation>normal</rotation>
<reflect_x>no</reflect_x>
<reflect_y>no</reflect_y>
<primary>yes</primary>
</output>
</configuration>
</monitors> |
Posted
on July 3, 2017, 3:48 pm,
by admin,
under
javascript.
<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> |
Posted
on June 29, 2017, 3:38 pm,
by admin,
under
css.
#rcorners1 {
border-radius: 25px;
} |
Posted
on June 28, 2017, 12:25 pm,
by admin,
under
javascript.
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> |
Posted
on June 28, 2017, 9:47 am,
by admin,
under
php.
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
Posted
on June 22, 2017, 9:01 am,
by admin,
under
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> |
Posted
on June 15, 2017, 12:02 pm,
by admin,
under
css.
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
Posted
on June 13, 2017, 11:56 am,
by admin,
under
git.