Skip to content

Instantly share code, notes, and snippets.

@cwhinfrey
cwhinfrey / bridge_hacks.md
Last active March 8, 2024 20:15
Bridge Hack List
@miguelmota
miguelmota / hdpaths.txt
Last active August 25, 2023 11:18
ETH HD Derivation Paths. Ledger Legacy, Ledger Live, Trezor, MetaMask
Ledger (legacy): m/44'/60'/0'/{account_index} (eg. 44'/60'/0'/0, 44'/60'/0'/1, 44'/60'/0'/2, etc)
ledger (live): m/44'/60'/{account_index}'/0/0 (eg. m/44'/60'/0'/0/0, m/44'/60'/1'/0/0, m/44'/60'/2'/0/0, etc)
trezor: m/44'/60'/0'/0/{account_index} (eg. m/44'/60'/0'/0/0, m/44'/60'/0'/0/1, m/44'/60'/0'/0/2, etc)
metamask: m/44'/60'/0'/0/{account_index} (eg. m/44'/60'/0'/0/0, m/44'/60'/0'/0/1, m/44'/60'/0'/0/2, etc)
import brownie
import eth_abi
import pytest
from hexbytes import HexBytes
from flashprofits import weiroll
@pytest.fixture
def alice(accounts):
@nneonneo
nneonneo / youtube-dl.py
Last active January 21, 2024 13:58
YouTube-DL for Pythonista - download YouTube videos on your iPhone/iPad!
#!python3
'''
Directions:
- install yt-dlp via Pip (e.g. using (StaSh)[https://github.com/ywangd/stash] - `pip install yt-dlp`)
- add this script as a Share extension through Settings -> Share Extension Shortcuts
- while watching a video in the YouTube site or app, just share the video to Pythonista and select this script
- the video will download, and when it's done you can share the video file itself with any app (e.g. VLC)
Advanced usage:
@empeje
empeje / README.md
Last active November 19, 2022 14:56
Setup pyenv in fish shell

Setup pyenv

Required dependencies

brew install pyenv
brew install zlib
brew install sqlite
@k06a
k06a / 4bytes.json
Created September 5, 2018 07:45
4bytes.json
This file has been truncated, but you can view the full file.
{
"0x94f61134":"executeOrder(uint256)",
"0xc5fee757":"executeOrder2(uint256)",
"0xe9fca283":"buy(uint256,bytes32)",
"0x0ed74c08":"func_0C2C()",
"0xba485844":"func_0C0E()",
"0x6971d64c":"func_0AB9()",
"0xe31e2d6d":"func_0A93()",
"0x304bac6f":"func_0A6E()",
@Geoyi
Geoyi / python_environment_setup.md
Created January 20, 2018 19:01 — forked from wronk/python_environment_setup.md
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. That way you can keep each project in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. This intermediate guide covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.

Use cases

  1. Working on 2+ projects that each have their own dependencies; e.g., a Python 2.7 project and a Python 3.6 project, or developing a module that needs to work across multiple versions of Python. It's not reasonable to uninstall/reinstall modules every time you want to switch environments.
  2. If you want to execute code on the cloud, you can set up a Python environment that mirrors the relevant
@0xallie
0xallie / lossless-stream-rip-cheatsheet.md
Last active March 18, 2024 01:02
Lossless stream rip cheatsheet

Lossless stream rip cheatsheet

Note: This guide may be slightly outdated. It may be still useful for older releases, but nowadays the vast majority of releases are correctly tagged as WEB-DL (unless it's RARBG/rartv). Protip: prefer looking at file names instead of release names, as they tend to be more accurate.

This is a short cheatsheet to help you determine whether a release from Amazon, Hulu, or Netflix contains the lossless/untouched (as in no further loss of quality compared to what the streaming services provide) video/audio or not. Most newer P2P releases are correctly tagged, but for older releases, it cannot be reliably determined based on the tags alone.

In most cases, non-lossless rips from these services are screen captures (which, when done by professional releasers, should be high quality and contain little to no glitches – see the history section for details), but in some cases they may be simply reencoded from the untouched stream, for example to crop black bars or reencode from a

@obskyr
obskyr / stream_response.py
Last active February 14, 2024 20:18
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator