Skip to content

Instantly share code, notes, and snippets.

@benjiqq
benjiqq / socket_connection.py
Created March 5, 2019 06:41 — forked from marif4444/socket_connection.py
Delta websocket connection
import websocket
import hashlib
import hmac
import base64
import datetime
import json
import time
import signal
from threading import Thread
@benjiqq
benjiqq / pyrx.py
Created October 6, 2018 14:32 — forked from mbillingr/pyrx.py
Implementation of a minimal Forth interpreter/compiler on top of Python 3.5.
""" pyrx
Implementation of a minimal Forth interpreter/compiler on top of Python 3.6.
It is based on Rx [1] and should eventually support Retro [2].
Facts & Features:
- New words are compiled to Python bytecode (subroutine threading model).
- Dynamically typed: the only data type is the Python object.
- Literals are evaluated as Python expressions.
- The data stack is a global Python list.
@benjiqq
benjiqq / gist:1b95318b8e205d6e3dc372086c180156
Created September 5, 2018 09:49 — forked from jamesp/gist:1385745
A simple cache for keeping timeseries data in memory
from bisect import bisect_left, bisect_right
class TimeseriesCache(object):
"""Store a timeseries of data in memory for random access."""
def __init__(self, ttl=None):
self.timestamps = []
self.data = []
self.ttl = ttl
def add(self, timestamp, data):
{
"config": {
"chainId": 89,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"clique": {
@benjiqq
benjiqq / purity_walkthrough.md
Created June 4, 2018 11:50 — forked from paulhauner/purity_walkthrough.md
Casper LLL Purity Checker Walk-through

Casper Purity Checker LLL Walk-through

WARNING: These are notes and are not complete, they may contain errors. They certainly contain awkward language (sorry).

These are my notes from reading the Casper LLL Purity Checker currently being reviewed here: ethereum/casper#143

Specifically, the casper/contracts/purity_checker.py file.

Preamble

@benjiqq
benjiqq / purity_walkthrough.md
Created June 4, 2018 11:50 — forked from paulhauner/purity_walkthrough.md
Casper LLL Purity Checker Walk-through

Casper Purity Checker LLL Walk-through

WARNING: These are notes and are not complete, they may contain errors. They certainly contain awkward language (sorry).

These are my notes from reading the Casper LLL Purity Checker currently being reviewed here: ethereum/casper#143

Specifically, the casper/contracts/purity_checker.py file.

Preamble

0x8D68583e625CAaE969fA9249502E105a21435EbF
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@benjiqq
benjiqq / ENS.md
Created August 4, 2016 20:26 — forked from Arachnid/ENS.md
  EIP: draft
  Title: Ethereum Domain Name Service - Specification
  Author: Nick Johnson 
  Status: Draft
  Type: Informational
  Created: 2016-04-04

Abstract