cd /var/lib/libvirt/qemu/
sudo virt-builder fedora-26 \
--arch x86_64 \
--size 20G \
-m 8192 \
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Ordinary function acting as constructor for parent object | |
var Species = function(canFly){ | |
this.canFly = canFly; | |
} | |
//Instantiating the parent object (Nothing new here) | |
var landAnimal = new Species(false); | |
//Ordinary function acting as constructor for child object | |
var Dog = function(numLegs){ | |
this.numLegs = numLegs; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Object.create() creates an empty Object landAnimal | |
var landAnimal = Object.create(); | |
//canFly property is set for landAnimal which will be used as the parent object | |
landAnimal.canFly = false; | |
//Object.create(landAnimal) will create an object with landAnimal as the __proto__ | |
var Dexter = Object.create(landAnimal); | |
//numLegs property is set for the child object Dexter | |
Dexter.numLegs = 4; | |
console.log(Dexter.numLegs); //numLegs is found at Dexter so it will print 4 | |
console.log(Dexter.canFly); // canFly not found at Dexter, but found at __proto__ (i.e. landAnimal) so it will print false |
English manual for the ZUOYA GMK67 Mechanical Keyboard. Made from the printed version (Original).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Rose = { | |
color : 'Red', | |
hasThorns : true | |
} | |
//whiteRose is child of Rose | |
var whiteRose = Object.create(Rose); | |
//both parent and child have the "color" property | |
whiteRose.color = 'White'; | |
console.log(whiteRose.color); // prints white, due to property shadowing | |
console.log(whiteRose.hasThorns); // prints true, no property shadowing |
See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var product = { | |
price : 10, | |
increment : function(hike){ | |
this.price += hike; | |
} | |
} | |
var Vegetable = function(){ | |
this.price = 100; | |
} | |
//prototype object product will be used to set the parent of instantiated object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Ordinary function to be used as constructor | |
var Employee = function(name, age){ | |
this.name = name; | |
this.age = age; | |
} | |
//Instantiate an Employee object using the new keyword | |
var al = new Employee('al', 50); | |
console.log('name : ' + al.name + ' age : '); //will return name : al age : 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Object creation via Object Literal | |
//prototype chain : obj.__proto__ -> Object().__proto__ -> null | |
var obj = { a : 'a'} | |
//Function creation via Function literal | |
//prototype chain : func.__proto__->Function().__proto__->Object().__proto__->null | |
var func = function(){ | |
return 2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//parent and child will inherit from the Object Prototype | |
//prototype chain for parent : parent -> Object Prototype | |
var parent = { | |
name : 'Tommy', | |
species : 'dog' | |
} | |
//prototype chain for child : child -> Object Prototype | |
var child = { | |
name : 'Dexter' | |
} |
NewerOlder