Skip to content

Instantly share code, notes, and snippets.

View k06a's full-sized avatar
🚀
DeFi dreamer

Anton Bukov k06a

🚀
DeFi dreamer
View GitHub Profile
@ritzdorf
ritzdorf / EIP1884.md
Last active September 27, 2022 12:03
Recently Executed Transactions affected by EIP1884

Recently Executed Contracts with Issues in EIP 1884

EIP 1884 is set to be implemented into the upcoming Ethereum 'Istanbul' hard fork. It

  • increases the cost of opcode SLOAD from 200 to 800 gas
  • increases the cost of BALANCE and EXTCODEHASH from 400 to 700 gas
  • adds a new opcode SELFBALANCE with cost 5.
@banteg
banteg / get_tokens.py
Last active August 13, 2021 04:07
get all tokens a user has interacted with
from web3 import Web3, HTTPProvider
from eth_utils import encode_hex, event_signature_to_log_topic
from eth_abi import encode_single
w3 = Web3(HTTPProvider('http://127.0.0.1:8545', {'timeout': 120}))
transfer_topic = encode_hex(event_signature_to_log_topic('Transfer(address,address,uint256)'))
def get_tokens(address):
@miguelmota
miguelmota / Cargo.toml
Created November 27, 2018 22:53
Rust sha3 (keccak256) example
[dependencies]
rust-crypto = "0.2"
@mattolenik
mattolenik / trapadd.sh
Created September 12, 2018 16:03
bash trap add
# From https://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
# note: printf is used instead of echo to avoid backslash
# processing and to properly handle values that begin with a '-'.
log() { printf '%s\n' "$*"; }
error() { log "ERROR: $*" >&2; }
fatal() { error "$@"; exit 1; }
# appends a command to a trap
#
root@Kali:~/Desktop/reverse-app-node# npm start
> reverse-app@0.0.0 start /root/Desktop/reverse-app-node
> node --inspect ./bin/www
Debugger listening on ws://127.0.0.1:9229/68079805-6415-4083-a07e-448a490b7967
For help see https://nodejs.org/en/docs/inspector
internal/modules/cjs/loader.js:550
throw err;
^
@banteg
banteg / contracts.yml
Created December 5, 2017 20:22
import cryptokitties in elasticsearch
auction:
address: '0xb1690C08E213a35Ed9bAb7B318DE14420FB57d8C'
abi: [{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_startingPrice","type":"uint256"},{"name":"_endingPrice","type":"uint256"},{"name":"_duration","type":"uint256"},{"name":"_seller","type":"address"}],"name":"createAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"bid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"lastGen0SalePrices","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"fu

от Али-Бабы и разбойников, к лье под водой и к вархаммеру

Давайте я сразу скажу - речь пойдет о биткоинах. При этом не буду вас агитировать за или против - это вообще не мое дело. Я просто расскажу вам о своем отношении к этому феномену и мифам вокруг него.

Для начала стоит сказать, что я не рассматриваю биткоин как валюту. Это не средство, которое заменит кредитные карты или ежедневные расчеты - для этого есть lightning network и другие средства децентрализации. Для меня биткоин - это актив, максимально похожий на золото во всех его проявлениях, кроме физического присутствия. Биткоины добывают, причем, чем больше биткоинов люди уже добыли, тем сложнее добывать дальше. Количество биткоинов, которые вообще можно будет добыть и пустить в оборот, фиксировано. Обмен биткоинами происходит “из рук в руки”. Хранить биткоины не трудно, затратно только получить или передать их. Замените “биткоины” на “золото” - каждое из этих заявлений так же будет действительно.

Поведение “золотых с

@pierrenoizat
pierrenoizat / p2sh_p2wpkh.rb
Last active December 16, 2021 09:26
Generate Segwit P2SH-P2WPKH address, create tx spending from it.
require 'bitcoin'
include Bitcoin
include Bitcoin::Builder
include Bitcoin::Protocol
include Bitcoin::Util
include Bitcoin::Secp256k1
# Compute P2SH-P2WPKH address:
@agentcooper
agentcooper / 0.README.md
Last active April 9, 2024 19:27
Telegram chat backup/export

How to use

  1. Login to https://web.telegram.org
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.

Motivation

@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active April 23, 2024 20:53
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file