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
| /** Lottery Contract with VRF **/ | |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.7; | |
| import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; | |
| import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; | |
| import "@chainlink/contracts/src/v0.8/ConfirmedOwner.sol"; | |
| contract Lottery is VRFConsumerBaseV2, ConfirmedOwner { | |
| event RequestSent(uint256 requestId, uint32 numWords); |
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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.7; | |
| import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; | |
| import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; | |
| import "@chainlink/contracts/src/v0.8/ConfirmedOwner.sol"; | |
| contract Lottery is VRFConsumerBaseV2, ConfirmedOwner { | |
| event RequestSent(uint256 requestId, uint32 numWords); | |
| event RequestFulfilled(uint256 requestId, uint256[] randomWords); |
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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.7; | |
| import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; | |
| import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; | |
| import "@chainlink/contracts/src/v0.8/ConfirmedOwner.sol"; | |
| contract Lottery is VRFConsumerBaseV2, ConfirmedOwner { | |
| event RequestSent(uint256 requestId, uint32 numWords); | |
| event RequestFulfilled(uint256 requestId, uint256[] randomWords); |
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
| /** | |
| *Submitted for verification at Etherscan.io on 2021-11-26 | |
| */ | |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.7; | |
| contract Lottery { | |
| uint MAX_PLAYERS = 3; | |
| address manager; |
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
| #!/bin/bash | |
| function exit_on_error(){ | |
| echo $1 | |
| git add . | |
| git stash | |
| git stash drop | |
| echo 'moving to master' | |
| git checkout master | |
| exit 1 |
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
| // | |
| // Divide and Conquer Algorithms, Assignment 2 | |
| // | |
| abstract class MergeSort{ | |
| public static inversions: number = 0; | |
| public static sort(arr: number[]) { | |
| if (arr.length < 2) return arr; |
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
| /** | |
| * Count bytes in a string's UTF-8 representation. | |
| * Source: https://codereview.stackexchange.com/questions/37512/count-byte-length-of-string | |
| * | |
| * @param string | |
| * @return int | |
| */ | |
| function getByteLen(normal_val) { | |
| // Force string type | |
| normal_val = String(normal_val); |
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
| // https://pascalprecht.github.io/slides/angular-2-change-detection-explained/#/109 | |
| @Component() | |
| class AnotherCmp { | |
| notifier:Observable<any>; | |
| constructor(private cd: ChangeDetectorRef) {} | |
| ngOnInit() { |