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
""" | |
Simple preforking echo server in Python. | |
Python port of http://tomayko.com/writings/unicorn-is-unix. | |
""" | |
import os | |
import sys | |
import socket |
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 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 |
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
// 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" | |
}, |
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
# 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 |