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 ChatGPT Codex Usage: Weekly Linear Usage Graph | |
| // @namespace https://chatgpt.com/ | |
| // @version 0.0.3 | |
| // @description Adds a linear weekly usage graph (100->0 over 7 days) + an X marker for current remaining usage. | |
| // @match https://chatgpt.com/codex/settings/usage* | |
| // @run-at document-idle | |
| // @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 functools | |
| import time | |
| from collections import OrderedDict | |
| class LRUCache: | |
| def __init__(self, max_size, expiry_hours): | |
| self.cache = OrderedDict() | |
| self.max_size = max_size | |
| self.expiry_seconds = expiry_hours * 3600 |
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
| from multiprocessing import Pool | |
| import datetime | |
| import time | |
| import os | |
| def f(x): | |
| time.sleep(0.2) | |
| return x*x | |
| before = datetime.datetime.now() |