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
# Apache configuration for running local browser against a locally running xxxx for manual smartcard testing | |
# Listen 4433 | |
<VirtualHost 127.0.0.1:4433> | |
# Real men use mod_proxy | |
DocumentRoot "/nowhere" | |
ServerName local-apache | |
ServerAdmin you@example.com |
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
"""py.test fixtures for spinning up a WSGI server for functional test run.""" | |
import threading | |
import time | |
from pyramid.router import Router | |
from waitress import serve | |
from urllib.parse import urlparse | |
import pytest |
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 erdpy.accounts import Account, Address | |
from erdpy.proxy import ElrondProxy | |
from erdpy.transactions import BunchOfTransactions | |
from erdpy.transactions import Transaction | |
from erdpy.wallet import signing | |
proxy = ElrondProxy("https://devnet-gateway.elrond.com") | |
sender = Account(pem_file="test-wallet.pem") | |
sender.sync_nonce(proxy) |
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.7; | |
pragma abicoder v2; | |
contract ArrayTest { | |
function colourToString(uint r, uint g, uint b) private pure returns(string memory) { | |
bytes memory alphabet = "0123456789abcdef"; |
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
with pq.ParquetWriter( | |
fname, | |
Candle.to_pyarrow_schema(small_candles), | |
compression='snappy', | |
allow_truncated_timestamps=True, | |
version='2.0', # Highest available schema | |
data_page_version='2.0', # Highest available schema | |
) as writer: | |
def reset_data(): |
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
class EthereumAddress(types.TypeDecorator): | |
"""SQLAlchemy class to store Ethereum addresses as binary in SQL database. | |
Ethereum address is 160 bits, the last bytes of 256 bit public key of the address's signer. | |
Ethereum address checksum is encoded in the case of hex letters. | |
We skip any Ethereum address checksum checks, as they slow down large data processing too much. | |
Any returned address data will be in lowercase. | |
""" |
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
import logging | |
import time | |
import timeit | |
from typing import Type | |
from sqlalchemy.orm import Session | |
from sqlalchemy.sql import text | |
from dex_ohlcv.db import get_real_database | |
from dex_ohlcv.models.uniswap import Base, UniswapLikeCandle, Pair |
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
-- Get all approve() transaction | |
-- Web3.utils.keccak256("approve(address,uint256)").slice(0, 10); | |
-- '0x095ea7b3' | |
WITH txdata as ( | |
SELECT tx.hash as txid, tx.block_timestamp as block_timestamp, cast(tx.receipt_gas_used as numeric) * cast(tx.gas_price as numeric) as cost FROM | |
bigquery-public-data.crypto_ethereum.transactions as tx | |
where | |
tx.input | |
LIKE "0x095ea7b3%") | |
SELECT (SUM(cost) / POWER(10, 18)) as eth_cost from txdata; |
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 HDWallet = require('ethereum-hdwallet') | |
const mnemonic = 'your seed prhase goes here' | |
const hdwallet = HDWallet.fromMnemonic(mnemonic) | |
for(let i=0; i<1000; i++) { | |
console.log(`0x${hdwallet.derive(`m/44'/60'/0'/0/${i}`).getAddress().toString('hex')}, 3.33`) | |
} |
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
def _console(context: ProcessContext): | |
imported_objects = {} | |
import datetime | |
from IPython import embed | |
from dex_ohlcv.models.base import Base | |
imported_objects["db_session_scoper"] = context.create_db_session_scoper() | |
imported_objects["web3"] = context.create_web3() | |
imported_objects["datetime"] = datetime |