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] |
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
#!/bin/bash | |
# Modified from: https://faq.i3wm.org/question/2332/flexible-monitor-setup/ | |
SWITCH_WS="${HOME}/scripts/i3-switch-ws" | |
# Switch screens on, in case they were asleep | |
xset dpms force on | |
# Find laptop display (DEFAULT) | |
DEFAULT=`xrandr | grep -e eDP.*connected | cut -f 1 -d ' '` |
NewerOlder