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
pragma solidity >=0.8.0 <0.9.0; | |
/** | |
* @notice Function for players to commit their choice | |
* @dev players can commit multiple times to change their choice until the other player commits | |
* @param choice - "rock", "paper" or "scissors" | |
* @param salt - a player chosen secret string used to "salt" the commit hash | |
*/ | |
function commit(string memory choice, string memory salt) | |
public | |
validGameState(activeGame[msg.sender], GameState.CommitPhase) |
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
pragma solidity >=0.8.0 <0.9.0; | |
//SPDX-License-Identifier: MIT | |
contract RockPaperScissors { | |
// 4 Game Phases: Join, Commit, Reveal, Result | |
enum GameState { | |
JoinPhase, | |
CommitPhase, | |
RevealPhase, |
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
"Arrow Function": { | |
"prefix": "arfn", | |
"body": [ | |
"const $1 = () => {", | |
"return ", | |
"};", | |
"$2" | |
], | |
"description": "Arrow Function" | |
} |
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
"Fat Console Log": { | |
"prefix": "clgf", | |
"body": [ | |
"console.log('\\n\\n\\nhellothere\\n',$1,'\\n\\n\\n');", | |
"$2" | |
], | |
"description": "Fat Console Log" | |
}, |
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
server_name mynewsite.com www.mynewsite.com; | |
location / { | |
#----------Add this section----------- | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_pass http://127.0.0.1:3000; | |
proxy_redirect off; |
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
FROM node:8-alpine | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY . . | |
RUN npm install | |
EXPOSE 3000 | |
CMD [ "node", "server.js" ] |
NewerOlder