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
| #!/usr/bin/env python3 | |
| import time | |
| import uuid | |
| import random | |
| import requests | |
| # This script is tested and working as of September 2020. | |
| # It is only a slightly modified version of leezu's script: https://gist.github.com/leezu/2efb1533d453b70db406b58eb6e3a2af | |
| # leezu gets 99.9% of the credit |
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
| # Authors: Mathieu Blondel, Vlad Niculae | |
| # License: BSD 3 clause | |
| import numpy as np | |
| def _gen_pairs(gen, max_iter, max_inner, random_state, verbose): | |
| rng = np.random.RandomState(random_state) | |
| # if tuple, interpret as randn |
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
| ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub |
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 aiohttp import web | |
| from threading import Thread | |
| import asyncio | |
| import time, uuid | |
| loop = asyncio.get_event_loop() | |
| def long_blocking_thing(sleep): | |
| time.sleep(sleep) | |
| return 42 |
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
| #!/usr/bin/env python | |
| # 1. Save this file in your ~/.gimp-2.8/plug-ins/ directory | |
| # 2. Run gimp from terminal | |
| # 3. Go to Filters/Python-Fu/IPython Console | |
| # 4. Go back to terminal to enjoy interactive Gimp scripting | |
| # | |
| import gimpfu | |
| import gimp | |
| from gimpfu import pdb |
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 json, datetime | |
| class RoundTripEncoder(json.JSONEncoder): | |
| DATE_FORMAT = "%Y-%m-%d" | |
| TIME_FORMAT = "%H:%M:%S" | |
| def default(self, obj): | |
| if isinstance(obj, datetime.datetime): | |
| return { | |
| "_type": "datetime", | |
| "value": obj.strftime("%s %s" % ( |