Skip to content

Instantly share code, notes, and snippets.

View Sekenre's full-sized avatar
💭
Neck reveal when?

Sekenre

💭
Neck reveal when?
View GitHub Profile
"""
Inspired by: https://github.com/dabeaz/blog/blob/main/2023/three-problems.md
"""
import datetime as dt
from enum import IntEnum
import struct
from dataclasses import dataclass
class Major(IntEnum):
@Sekenre
Sekenre / flask_tar.py
Created March 7, 2022 12:56 — forked from boris317/flask_tar.py
Stream a tar file with flask.
import os
from cStringIO import StringIO
import tarfile
from flask import Flask, Response
app = Flask(__name__)
def get_string_io_len(s):
@Sekenre
Sekenre / embedded.py
Last active May 28, 2021 17:17
Embedded CBOR example
from binascii import hexlify
from io import BytesIO
import cbor2
class Embedded:
def __init__(self, payload=None):
self.payload = payload
@Sekenre
Sekenre / simple_python_datasource.py
Created November 7, 2019 13:33 — forked from linar-jether/simple_python_datasource.py
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@Sekenre
Sekenre / bytes_concat.ipynb
Last active March 22, 2018 21:47
Profiling ways to concatenate chunked bytes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.