This file contains hidden or 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
// extract a core module like this | |
var http = require('http); | |
// extract a user defined module like this | |
var something = require('./folder1/folder2/folder3/something.js'); |
This file contains hidden or 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
if (typeof Object.create !== 'function') { | |
Object.create = function (o) { | |
var F = function () {}; | |
F.prototype = o; | |
return new F(); | |
}; | |
var otherPerson = Object.create(person); |
This file contains hidden or 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
// take order for table 1 and move on... | |
orderNonBlocking(['Coke', 'Iced Tea'], function(drinks){ | |
return serveOrder(drinks); | |
}); | |
// take order for table 2 and move on... | |
orderNonBlocking(['Beer', 'Whiskey'], function(drinks){ | |
return serveOrder(drinks); | |
}); |
This file contains hidden or 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
// take order for table 1 and wait... | |
var order1 = orderBlocking(['Coke', 'Iced Tea']); | |
// once order is ready, take order back to table. | |
serveOrder(order1); | |
// once order is delivered, move on to another table. | |
// take order for table 2 and wait... | |
var order2 = orderBlocking(['Coke', 'Water']); |
This file contains hidden or 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
/** | |
* Does some magic | |
* @return an integer | |
*/ | |
public Integer goDoSomeMagic(){ | |
// Do some magic | |
return this.magicIsDone; | |
} |
This file contains hidden or 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
<?php | |
namespace Starfleet\Entity; | |
class StarfleetCadet | |
{ | |
private $klingonSpeaker; | |
public function isKlingonSpeaker() | |
{ | |
return $this->klingonSpeaker; | |
} | |
public function setKlingonSpeaker($klingonSpeaker) |
This file contains hidden or 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
public class StarfleetCadet { | |
private boolean klingonSpeaker; | |
public boolean isKlingonSpeaker(){ | |
return this.klingonSpeaker; | |
} | |
public void setKlingonSpeker(boolean klingonSpeakerIn){ | |
this.klingonSpeaker = klingonSpeakerIn; | |
} |
This file contains hidden or 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
public class StarfleetCadet | |
{ | |
private bool KlingonSpeaker; | |
public bool IsKlingonSpeaker(){ | |
return this.klingonSpeaker; | |
} | |
public void SetKlingonSpeaker(bool klingonSpeakerIn){ | |
this.klingonSpeaker = klingonSpeakerIn; |
This file contains hidden or 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
if(IntegerEntered >= 1 && IntegerEntered <= 5) | |
DisplayMessage(“Success”); |
This file contains hidden or 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
if(number >= 1 && number <=5) | |
DisplayMessage("Success") | |
else if(number >= 5 && number <=9) | |
DisplayMessage("Monkeys") | |
else (number >= 9 && number <=11) | |
DisplayMessage("Bananas") |