This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name PoE2 Trade Copy Item Button | |
| // @version 2.1 | |
| // @description Adds a button to the PoE2 Trade page that allows you to copy the item description and affixes to your clipboard. | |
| // @author Kevin M | |
| // @match https://www.pathofexile.com/trade2/* | |
| // @icon https://www.google.com/s2/favicons?domain=pathofexile.com | |
| // @downloadURL https://gist.github.com/Krytos/fcb435878b9ee214c8ef9c5d9a685861/raw/poe2trade.user.js | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| character_translation_table = str.maketrans('"*/:<>?\\|\t\n\v\f\r', '"*/:<>?\│ ') | |
| leading_space_pattern = re.compile(r'^\s+') | |
| def replace_illegal_filename_characters(input_filename: str): | |
| r""" | |
| Replace illegal characters with full-width variant | |
| Table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| golden_ratio = 0x9E3779B9 | |
| max_int = 2**32 - 1 | |
| def rotate_left_5(value): | |
| return ((value << 5) | (value >> 27)) & max_int | |
| def add_to_hash(hash_value, value): | |
| return (golden_ratio * (rotate_left_5(hash_value) ^ value)) & max_int | |
| def hash_simple(url): |