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
{ | |
"editor.minimap.enabled": false, | |
"terminal.integrated.fontSize": 13, | |
"[markdown]": { | |
"editor.unicodeHighlight.ambiguousCharacters": false, | |
"editor.unicodeHighlight.invisibleCharacters": false, | |
"diffEditor.ignoreTrimWhitespace": false, | |
"editor.wordWrap": "bounded", | |
"editor.wordWrapColumn": 100, | |
"editor.quickSuggestions": { |
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
#!/bin/bash | |
# | |
# Mirror directory structures on remote and local machines. | |
# | |
# This requires "mirror" accounts with sudo privileges having NOPASSWD for | |
# /usr/bin/rsync. This enables rsync to read/write files not owned by the | |
# mirror. The corresponding sudoers entry (visudo sudoers): | |
# | |
# mirror ALL=(ALL) NOPASSWD: /usr/bin/rsync | |
# |
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
""" | |
A simple reservoir sampler class adapted from Wikipedia pseudocode. | |
cf. https://en.wikipedia.org/wiki/Reservoir_sampling | |
""" | |
import numpy as np | |
class ReservoirSampler(object): | |
def __init__(self, seed : int = None): | |
self.rng = np.random.default_rng(seed = seed) |
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 | |
"""Generate a QR code from a URL | |
usage: qr.py [-h] [--url URL] [--interactive] [--output OUTPUT] [--size SIZE] | |
options: | |
-h, --help show this help message and exit | |
--url URL | |
--interactive | |
--output OUTPUT a PNG file |
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
"""A fork and monitor pattern, asyncio with named sockets | |
author: Dustin Lennon | |
email: dustin.lennon@gmail.com | |
Generate heartbeats in a parent process; check heartbeats in a child process. The | |
most recent heartbeat is saved in a file. The child exits when the parent terminates, | |
specifically when its parent pid changes. | |
This code also sets up a named socket in the filespace which enables shell interaction with |