Skip to content

Instantly share code, notes, and snippets.

View rsyring's full-sized avatar

Randy Syring rsyring

View GitHub Profile
@rsyring
rsyring / app.py
Created May 26, 2022 04:19
Write CSV files to a Zip file and serve with Falcon (Python)
import csv
import io
import tempfile
import zipfile
import falcon
GB = 1024 ^ 3
MEM_MAX_SIZE = 1 * GB
@rsyring
rsyring / demo.py
Created August 15, 2024 06:02
flask server_name issue
from flask import Flask, url_for
import pytest
@pytest.fixture
def app():
app = Flask(__name__)
@app.route('/')
def view():
@rsyring
rsyring / tasks_lib.py
Created May 30, 2025 20:12
Systemd Run for Mise Python Tasks
import contextlib
class SystemdRun:
def __init__(self, unit_name: str, restart_wait: str = '5s'):
self.unit_name = unit_name
self.restart_wait = restart_wait
def stop(self):
sub_run('systemctl', '--user', 'stop', self.unit_name, capture=True, check=False)
[Unit]
Description=Github online service
After=network-online.target
# Unlimited retries
StartLimitBurst=0
[Service]
Type=exec