Skip to content

Instantly share code, notes, and snippets.

View jnmclarty's full-sized avatar

Jeffrey McLarty jnmclarty

View GitHub Profile
@jnmclarty
jnmclarty / pull_liquidity.py
Created August 3, 2023 13:43
Pull UniV3 Topics
# -*- coding: utf-8 -*-
import json
import datetime as dt
import requests as r
MINT_TOPIC = '0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde'
BURN_TOPIC = '0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c'
@jnmclarty
jnmclarty / lighthouse_reth.sh
Created July 29, 2023 02:19
Boot up Lighthouse 4.30 from Binary & Reth from Source
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
echo source $HOME/.cargo/env >> ~/.bashrc
# Install Reth Dependencies
sudo apt-get install libclang-dev pkg-config build-essential
git clone https://github.com/paradigmxyz/reth
cd reth
@jnmclarty
jnmclarty / rex_user_benefit_map.md
Last active July 23, 2017 22:26
REX User Benefit Map - A Critic & Questions

The text below has been transcribed from a video produced by REX MLS. For certain bullets, I broke out lines where there were two ideas on one line.

1. BROKER

  • List for $0.10 - $0.20/per listing
  • Global Listing Exposure
  • Data Ownership
  • Earn REX for listing
  • Monetize listings via ads/market reports
  • Earn REX Merits based on reputation
  • Predictable commission payouts (Phase 3)
@jnmclarty
jnmclarty / flask_pyenvdiff.py
Created February 12, 2017 02:19
How to add an endpoint for environment info to any Flask App
import json
# Assuming you've instantiated a Flask app...
from pyenvdiff import Environment
@app.route('/pyenv')
def pyenv():
info = Environment().info()
resp = json.dumps(info)
@jnmclarty
jnmclarty / python_ubuntu_16.04.1.md
Last active March 3, 2018 20:58
How to Set up Python w/ a Seperate Anaconda for Multiple-Projects on Ubuntu 16.04.1 LTS x64

1. Setup Ubuntu-level Stuff for a Python Dev

apt-get update
adduser jnmclarty
usermod -aG sudo jnmclarty
su - jnmclarty
sudo apt-get -y upgrade
sudo apt-get install make build-essential libssl-dev libffi-dev python-dev python-virtualenv zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils
@jnmclarty
jnmclarty / cent_os_pymqi_27_35.sh
Last active November 15, 2016 01:48
Create dev environment for CentOS/PyMQI
cd ~
wget http://repo.continuum.io/archive/Anaconda3-4.2.0=Linux-x86-64.sh
sudo yum install git
sudo yum groupinstall -y development
sudo yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
sudo yum install python-devel
bash Anaconda3-4.2.0-Linux-x86_64.sh
source .bashrc
conda create -n py27pymqi python=2.7
conda create -n py35pyqmi python=3.5
@jnmclarty
jnmclarty / performance.md
Last active April 28, 2023 22:05
Redis vs SQLlite In Memory vs SQLite Disk

Redis Results

0.00922203063965

2611-04-18

0.0102469921112

2385-05-21

@jnmclarty
jnmclarty / partial.py
Last active December 1, 2015 02:42
partial usage of partial
from functools import partial
import os
rel_path = partial(os.path.join, os.path.dirname(__file__))
f = rel_path("../config/foo.ini")
print_stderr = partial(print, file=sys.stderr)
@jnmclarty
jnmclarty / dry_checker.py
Last active September 6, 2015 14:15
Code Duplication Checker
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 06 07:29:38 2015
@author: Jeffrey
"""
"""
Python code clone detector,
using Abstract Syntax Trees.
@jnmclarty
jnmclarty / .pypirc
Created August 15, 2015 13:01
Multiple Server config for pypi
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository: https://pypi.python.org/pypi
username: jmclarty
password: