Skip to content

Instantly share code, notes, and snippets.

View MirzaChilman's full-sized avatar

Mirza MirzaChilman

View GitHub Profile
@MirzaChilman
MirzaChilman / contracts...StorageFactory.sol
Created November 20, 2021 04:11
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
import "./SimpleStorage.sol";
contract StorageFactory {
SimpleStorage[] public simpleStorages;
function createSimpleStorageContract() public {
SimpleStorage simpleStorage = new SimpleStorage();
@MirzaChilman
MirzaChilman / contracts...SimpleStorage.sol
Created November 20, 2021 04:11
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
contract SimpleStorage {
uint256 public favoriteNumber;
struct People {
uint256 favoriteNumber;
string name;
@MirzaChilman
MirzaChilman / README.txt
Created November 20, 2021 04:10
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@MirzaChilman
MirzaChilman / twoNumberSum.js
Created August 2, 2020 13:13
two number sum
// O(n) time | O(n) space
function twoNumberSub(array, targetSum){
let hashNumbers = {}
for(const num of array){
let potentialMatch = targetSum - num
if(potentialMatch in hashNumbers){
return [potentialMatch, num]
}else{
hashNumbers[num] = true // or whatever value you want, because we don't care about the value only key
import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
class App extends React.Component {
state = {
data: [],
numberPaginate: 1,
position: 0,
dataFinal: []
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.box {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@MirzaChilman
MirzaChilman / index.html
Created September 26, 2018 08:25
Latihan test kerja 1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">