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
FROM node:8-alpine | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY . . | |
RUN npm install | |
EXPOSE 3000 | |
CMD [ "node", "server.js" ] |
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
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 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 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 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 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 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 reveal their choice. The first player to reveal sets a deadline for the second player | |
* this is prevent players for abandoning the game once they know they have lost based on the revealed hash. | |
* At the end of the deadline, the player who committed can trigger a "win-by-default". | |
* If both players reveal in time, the second player's reveal will call determineWinner() and advance the game to the result phase | |
* @notice Unlike commit, players can only reveal once | |
* @param salt - a player chosen secret string from the "commit" phase used to prove their choice via a hash match | |
*/ |
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.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 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.0 <0.9.0; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/utils/Strings.sol"; | |
import "@openzeppelin/contracts/utils/Base64.sol"; | |
/** | |
* @title BuidlGuidl Tabard | |
* @author Daniel Khoo |
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
const API_KEY = "" // Add your etherscan API KEY here | |
let widget = await createWidget(); | |
// Check where the script is running | |
if (config.runsInWidget) { | |
// Runs inside a widget so add it to the homescreen widget | |
Script.setWidget(widget); | |
} else { | |
// Show the medium widget inside the app |
OlderNewer