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
defmodule Stack do | |
use GenServer | |
# Client | |
def start_link(default) when is_list(default) do | |
GenServer.start_link(__MODULE__, default) | |
end | |
def push(pid, element) do |
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
// doesn't throw error, but doesn't work: | |
const x = useTransform( | |
contentOffsetY, | |
[0, -400], | |
[0, endX], | |
[ | |
{ | |
clamp: false, | |
ease: [0.5], |
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
export function ScaleV2(): Override { | |
const [endX, endScale, endOpacity] = [-60, 0.5, 0.6] // TODO pass this from outside | |
const x = useTransform(contentOffsetY, [0, -400], [0, endX], { | |
clamp: false, | |
}) | |
const scale = useTransform(contentOffsetY, [0, -400], [1, endScale], { | |
clamp: false, | |
}) | |
const opacity = useTransform(contentOffsetY, [0, -400], [1, endOpacity], { |
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.7.0 <0.9.0; | |
contract MyContract { | |
uint256 public peopleCount; | |
// Person[] public people; | |
mapping(uint => Person) public people; | |
struct Person { |
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.7.0 <0.9.0; | |
contract MyContract { | |
uint256 public peopleCount; | |
mapping(uint => Person) public people; | |
address owner; | |
uint256 openingTime = 1631171503; | |
/// uint256 openingTime = 1631171803; |
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.7.0 <0.9.0; | |
contract MyContract { | |
mapping(address => uint256) public balances; | |
address payable wallet; | |
event Purchase( | |
address indexed _buyer, | |
uint256 _amount |
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.7.0 <0.9.0; | |
contract ERC20Token { | |
string public name; | |
mapping(address => uint256) public balances; | |
function mint() public { | |
balances[tx.origin] ++; | |
} | |
} |
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.7.0 <0.9.0; | |
contract ERC20Token { | |
string public name; | |
mapping(address => uint256) public balances; | |
constructor(string memory _name) { | |
name = _name; | |
} | |
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.7.0 <0.9.0; | |
import "./SafeMath.sol"; | |
// import "./Math.sol"; | |
// library Math { | |
// function divide(uint256 a, uint256 b) internal pure returns (uint256) { | |
// require(b > 0); | |
// uint256 c = a / b; |
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.7.0 <0.9.0; | |
contract Escrow { | |
address agent; // nobody else can use this contract | |
mapping(address => uint256) public deposits; | |
modifier onlyAgent() { | |
require(msg.sender == agent); |
NewerOlder