Skip to content

Instantly share code, notes, and snippets.

@mmv08
mmv08 / unicorn.py
Created November 6, 2016 18:54
Simple preforking echo server in Python
"""
Simple preforking echo server in Python.
Python port of http://tomayko.com/writings/unicorn-is-unix.
"""
import os
import sys
import socket
@mmv08
mmv08 / main.py
Last active August 24, 2021 16:07
python ecrecover
from hexbytes import HexBytes
from ethereum.utils import checksum_encode, ecrecover_to_pub, sha3
from typing import Tuple, Union
def signature_split(signatures: Union[bytes, str], pos: int = 0) -> Tuple[int, int, int]:
"""
:param signatures: signatures in form of {bytes32 r}{bytes32 s}{uint8 v}
:param pos: position of the signature
:return: Tuple with v, r, s
@mmv08
mmv08 / wallet_batchTransactions.md
Last active May 13, 2022 10:45
# wallet_batchTransactions JSON-RPC method (v1, EOA-compatible)

Ethereum Developer Resources!

Hello, World! Here is a list of resources that I have found helpful when learning about blockchain development. I will continuously update this page as we are all learning together!

Opinion Pieces

Why Web3 Matters (Chris Dixon): here

Using Token Incentives to Bootstrap New Networks (Chris Dixon): here

// paste in console of any https site to run (e.g. this page)
// sample arguments for registration
// https://fidoalliance.org/specs/fido-u2f-v1.1-id-20160915/fido-u2f-raw-message-formats-v1.1-id-20160915.html#authentication-response-message-success
var createCredentialDefaultArgs = {
publicKey: {
// Relying Party (a.k.a. - Service):
rp: {
name: "Acme"
},
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# 4) also adds a global run_llm command that accepts a prompt
# based on https://gist.github.com/karpathy/1dd0294ef9567971c1e4348a90d69285
gcm-llm() {
# Function to generate commit message