This file contains 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
"""Convert exported Omnivore reading list to Wallabag v2 JSON format. | |
This is by no means well checked or perfect, but it should serve as a start for further efforts. | |
It got my list of articles imported into Wallabag, which is all I wanted. | |
""" | |
import json | |
import csv | |
from datetime import datetime | |
import glob |
This file contains 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
;; Allow org to understand github links | |
;; | |
;; Examples: | |
;; | |
;; gh:scikit-image/scikit-image#1000 | |
;; | |
;; By customizing org-gh-repo-shortcuts, you can have even shorter URLs: | |
;; | |
;; gh:skimage#1000 | |
;; |
This file contains 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 | |
import tomllib | |
import argparse | |
import sys | |
import subprocess | |
parser = argparse.ArgumentParser() | |
parser.add_argument( |
This file contains 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 numpy as np | |
from skimage.transform import warp, PolynomialTransform | |
from skimage import data | |
import matplotlib.pyplot as plt | |
def swirl(xy, x0, y0, R): | |
r = np.sqrt((xy[:,1]-x0)**2 + (xy[:,0]-y0)**2) | |
a = np.pi*r / R | |
xy = np.copy(xy) | |
xy[:, 1], xy[:, 0] = ( |
Much of Python’s popularity can be attributed to the rich collection of Python libraries available to developers. Authors of these libraries play an important role in improving the experience for Python developers. This document provides some recommendations and guidance for Python library authors.
These recommendations are intended to provide the following benefits:
This file contains 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 | |
# See https://github.com/Nakiami/MultithreadedSimpleHTTPServer/blob/master/MultithreadedSimpleHTTPServer.py | |
# Python 3.x | |
from socketserver import ThreadingMixIn | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer): | |
pass |
This file contains 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 subprocess | |
import time | |
import os | |
from datetime import datetime | |
# Check after every X minutes | |
delay = 60 |
This file contains 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 numpy as np | |
validators_online = 102 | |
consensus_size = 28 | |
replacement_factor = 4 | |
validators = np.arange(validators_online) | |
replacement_N = len(validators) // replacement_factor | |
N = 10000 |
This file contains 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
adapters = np.sort(adapters) | |
start = 0 | |
end = np.max(adapters) + 3 | |
cache = {} | |
def next_in_line(last_link): | |
if last_link in cache: | |
return cache[last_link] |
NewerOlder