Skip to content

Instantly share code, notes, and snippets.

View KenoLeon's full-sized avatar

Keno Leon KenoLeon

View GitHub Profile
@KenoLeon
KenoLeon / basic_promise.js
Last active April 8, 2022 00:36
basic promise for EVM operations
const EVM_OPERATION = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Done with Operation');
// uncomment this and comment the previous line to see the error
// reject('Something went wrong');
}, 600); // timeout of 600ms to simulate the operation
});
@KenoLeon
KenoLeon / metaMaskSign.html
Created March 13, 2022 01:41
Standalone MetaMask Signer for Medium Article tutorial
<!doctype html>
<html lang="en">
<!-- Standalone MetaMask Signer for A Medium Article: Signing messages in Ethereum medium.com/@k3no-->
<!-- Not to be used in production, just for educational purposes. -->
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
@KenoLeon
KenoLeon / metaMaskETHERSCallContract.html
Created February 22, 2022 00:57
Call contract with ETHERS along metamaks
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
@KenoLeon
KenoLeon / metaMaskAccountAddress.html
Created February 18, 2022 02:18
metamask Account address debugger
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
@KenoLeon
KenoLeon / MetaMasktestPageButtonConnect.html
Created February 17, 2022 02:20
MetaMasktestPageButtonConnect
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
@KenoLeon
KenoLeon / MetaMaskInstalledTest.html
Created February 16, 2022 01:13
Is MetaMask installed
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
@KenoLeon
KenoLeon / testPage.html
Last active February 15, 2022 02:17
TestPage for Metamask Debugger
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
@KenoLeon
KenoLeon / Action_Behavior.py
Created February 8, 2022 20:55
Action Behavior system pattern or Ais
# temperature = 0.5
# temperature = 0.6
# temperature = 0.3
if (temperature < 0.5):
print('will close valve')
elif (temperature > 0.5):
print('will open valve')
else:
print('will do nothing')
@KenoLeon
KenoLeon / perpetualStorage.sol
Created February 3, 2022 21:55
Perpetualstorage view solidity fro mediumarticle k3no
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract perpetualStorage {
function getString() public pure returns (string memory) {
return 'TIME IS MONEY';
}
}
@KenoLeon
KenoLeon / script_1.py
Last active January 27, 2022 01:12
Script for use with Brownie
from brownie import network
# Use: brownie run script_1.py
def main():
# list accounts
accounts = network.accounts
print("Accounts:")
for account in accounts:
print(account)