Skip to content

Instantly share code, notes, and snippets.

@0xOsprey
0xOsprey / raycastParseAndOpen.py
Created May 6, 2024 18:07
Raycast Python script for parsing clipboard and opening a link
#!/usr/bin/python3
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Parse and Open
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🔍
# @raycast.packageName Developer Util
@cwhinfrey
cwhinfrey / bridge_hacks.md
Last active July 20, 2024 16:39
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 April 2, 2024 04:57
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()",
"0x70357e79":"func_08D3()",
@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
@obskyr
obskyr / stream_response.py
Last active June 14, 2024 11:25
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