Skip to content

Instantly share code, notes, and snippets.

View rpaskin's full-sized avatar

Ronnie Paskin rpaskin

  • Rio de Janeiro, Brazil
  • 00:10 (UTC -03:00)
  • LinkedIn in/rpaskin
View GitHub Profile
@rpaskin
rpaskin / simpleStorage.html
Last active April 28, 2022 18:51
Example simpleStorage web3js integration
<!DOCTYPE html>
<html>
<head>
<title>Simple Storage</title>
<!-- <script src="https://cdn.jsdelivr.net/gh/ethereum/[email protected]/dist/web3.min.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.4.0-rc.0/web3.min.js"></script>
<button class="enableEthereumButton">Enable Ethereum</button>
<br><br>
pragma solidity ^0.5.0;
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
//
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
@rpaskin
rpaskin / SimpleStorage.sol
Created September 6, 2019 15:50
Simple Storage interface to smart contract
pragma solidity >=0.4.0 <0.7.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
pragma solidity >=0.4.0 <0.7.0;
// See https://solidity.readthedocs.io/en/v0.5.11/introduction-to-smart-contracts.html
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
@rpaskin
rpaskin / PennyAuction.sol
Created August 16, 2019 13:54
Simple(r) lowest unique bid auction example
pragma solidity >=0.4.0 <0.6.0;
// A unique bid auction is a type of strategy game related to traditional auctions where the
// winner is usually the individual with the lowest unique bid, although less commonly the
// auction rules may specify that the highest unique bid is the winner. Unique bid auctions
// are often used as a form of competition and strategy game where bidders pay a fee to make
// a bid, or may have to pay a subscription fee in order to be able to participate.
contract PennyAuction {
address payable public owner;
@rpaskin
rpaskin / PennyAuction.sol
Created August 16, 2019 03:21
Solidity example: unique lowest bid auction
pragma solidity >=0.4.0 <0.6.0;
// A unique bid auction is a type of strategy game related to traditional auctions where the
// winner is usually the individual with the lowest unique bid, although less commonly the
// auction rules may specify that the highest unique bid is the winner. Unique bid auctions
// are often used as a form of competition and strategy game where bidders pay a fee to make
// a bid, or may have to pay a subscription fee in order to be able to participate.
contract PennyAuction {
address payable public owner;
import random
def non_random_choice(list):
return random.choice(list)
def programar(algo):
tecnicas = ['algoritmos', 'IA', 'um chatbot', 'um framework', ' alguma tecnologia']
print(f'* TODO * Resolver {algo} com {non_random_choice(tecnicas)}')
def usar_ferramenta_para_resolver(algo):
print(123)
print(456)
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
import csv
driver = webdriver.Chrome()
with open('crawl.csv') as csv_file:
reader = csv.reader(csv_file, delimiter=',')
for row in reader:
driver.get(row[0].lstrip())