Skip to content

Instantly share code, notes, and snippets.

View LPX55's full-sized avatar

LPX LPX55

View GitHub Profile
@williamsfu99
williamsfu99 / keeper-example.py
Created February 2, 2022 20:35
Python example of Leveraged Index Strategy Rebalancing
import os
from web3 import Web3
# Populate these fields.
WEB3_PROVIDER = Web3(Web3.HTTPProvider('https://<your-provider-url>'))
LEVERAGE_STRATEGY_ADAPTER_ADDRESS = '<your-strategy-address-here>'
LEVERAGE_REBALANCE_VIEWER_ADDRESS = '<your-viewer-address-here>'
LEVERAGE_STRATEGY_ADAPTER_ABI = '[<your ABI>]'
LEVERAGE_REBALANCE_VIEWER_ABI = '[<your ABI>]'
@moeseth
moeseth / waveform.py
Created October 12, 2015 08:19
Create Soundcloud style waveform from Audio in Python
from pydub import AudioSegment
from matplotlib import pyplot as plot
from PIL import Image, ImageDraw
import numpy as np
import os
src = "./test.mp3"
audio = AudioSegment.from_file(src)
data = np.fromstring(audio._data, np.int16)
@dannvix
dannvix / intercept-https-with-python-mitmproxy.md
Last active March 6, 2025 01:41
Intercept and manipulate HTTPs traffic with Python and mitmproxy

Intercepts HTTPs Traffic with Python & mitmproxy

Warning

This Gist is created in 2014, and it's highliy outdated now, according to one of mitmproxy's manjor contributor (check his comment below). Thanks for letting us know, @mhils!

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.