Skip to content

Instantly share code, notes, and snippets.

View zulnabil's full-sized avatar
Always learning

Zulnabil Faiz Moh. Alhadad zulnabil

Always learning
View GitHub Profile
@zulnabil
zulnabil / contracts...ErcPredictionMarket.sol
Created June 26, 2024 18:02
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
// Using SafeERC20 for IERC20 tokens to safely interact with ERC20 tokens.
using SafeERC20 for IERC20;
contract PredictionMarket {
@zulnabil
zulnabil / contracts...ErcPredictionMarket.sol
Created June 26, 2024 18:02
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
using SafeERC20 for IERC20;
contract PredictionMarket {
enum EventType { Single, Multiple }
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Personal Site PWA</title>
<meta name="description" content="Personal Site PWA"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/materialize.min.css">
</head>
<body>
@zulnabil
zulnabil / App.js
Created June 28, 2019 13:00
Component App
import React from 'react';
import ScoreBoard from './components/ScoreBoard'
function App() {
return (
<div>
<ScoreBoard />
</div>
);
@zulnabil
zulnabil / ScoreBoard.jsx
Created June 28, 2019 12:54
Component ScoreBoard
import React from 'react'
import styled from 'styled-components'
import PanelScoreboard from './PanelScoreboard'
import InputTeam from './InputTeam'
const PanelScore = styled.div`
display: ${props => props.ready ? 'block' : 'none'}
`
@zulnabil
zulnabil / InputTeam.jsx
Created June 28, 2019 12:42
Component InputTeam
import React from 'react'
import styled from 'styled-components'
const PanelInputTeam = styled.div`
width: 400px;
margin: auto;
display: ${props => props.ready ? 'none' : 'flex'}
flex-direction: column;
justify-content: space-around;
`
@zulnabil
zulnabil / PanelScoreboard.jsx
Last active June 28, 2019 12:43
Component PanelScoreboard
import React from 'react'
import styled from 'styled-components'
import Score from './Score'
import Timer from './Timer'
import Foul from './Foul'
const Container = styled.div`
width: 500px;
@zulnabil
zulnabil / Foul.jsx
Last active June 28, 2019 12:39
Component Foul
import React from 'react'
import styled from 'styled-components'
const ObjFoul = styled.div`
text-align: center;
`
const PointFoul = styled.div`
font-size: 24pt;
`
@zulnabil
zulnabil / Score.jsx
Last active June 28, 2019 12:40
Component Score
import React from 'react'
import styled from 'styled-components'
const ObjScore = styled.div`
text-align: center;
`
const NameTeam = styled.div`
font-size: 18pt;
`
@zulnabil
zulnabil / Timer.jsx
Last active June 28, 2019 12:40
Fitur timer pada Scoreboard
import React from 'react'
import styled from 'styled-components'
const PanelTimer = styled.div`
margin: 30px 0;
font-size: 32pt;
text-align: center;
line-height: 18pt;
`