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
function LinkNode(value, prev = null, next = null) { | |
this.value = value; | |
this.prev = prev; | |
this.next = next; | |
} | |
function Queue() { | |
this.head = null; | |
this.tail = null; |
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
function getRandom(max = 1) { | |
return Math.floor((Math.random() * max)); | |
} | |
function Encoder(data) { | |
this.data = data; | |
this.dataLength = data.length; | |
this.makePacket = () => { | |
let result = 0; |
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
pragma solidity ^0.4.18; | |
contract Payroll { | |
uint256 public constant ONE_MONTH = 30 * 24 * 60 * 60; | |
address public owner; | |
address public exchangeOracle; | |
modifier ownerOnly() { | |
require(msg.sender == owner); |
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
pragma solidity ^0.4.11; | |
contract TaxAuthority { | |
address public owner; | |
mapping (address => uint) public taxesCollected; | |
modifier onlyOwner() { | |
require(msg.sender == owner); | |
_; | |
} |
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
pragma solidity ^0.4.11; | |
contract Interviewer { | |
address public answerer; | |
address public asker; | |
function Interviewer(address _asker, address _answerer) { | |
asker = _asker; | |
answerer = _answerer; | |
} |
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
pragma solidity ^0.4.11; | |
contract AnsweringMachine { | |
enum Status { | |
Here, | |
Busy, | |
Away | |
} | |
struct AwayStatus { |
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
pragma solidity ^0.4.11; | |
contract DMail { | |
address owner; | |
function DMail() public { | |
owner = msg.sender; | |
} | |
struct Message { |
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
pragma solidity ^0.4.11; | |
contract Wiki { | |
function Wiki() { | |
} | |
struct Diff { | |
address owner; | |
uint currentSwarmHash; |
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
pragma solidity ^0.4.10; | |
contract ReLike { | |
function ReLike() { | |
} | |
enum Rating { | |
UNRATED, | |
LIKE, | |
DISLIKE |
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
pragma solidity ^0.4.21; | |
contract MultiplayerGame { | |
uint[3] public SEMVER = [0, 1, 0]; | |
uint public numGames; | |
enum ListType { | |
None, | |
Whitelist, | |
Blacklist |
OlderNewer