Skip to content

Instantly share code, notes, and snippets.

View alexpovel's full-sized avatar
💭
Just trying to grep a git on life

Alex Povel alexpovel

💭
Just trying to grep a git on life
View GitHub Profile
@alexpovel
alexpovel / check.sh
Last active December 3, 2024 17:46
[CUE](https://cuelang.org/) vetting demo for embedded YAML (YAML serialized as a string in outer YAML, in this case Prometheus Alertmanager rules inside a Kubernetes ConfigMap resource)
#!/bin/sh
cue vet sample.cue sample.yaml
@alexpovel
alexpovel / git-url-path-extract.py
Last active August 9, 2024 17:25
Extract the path of git URLs (ssh, git@, https) in a file system-friendly representation.
"""Extract the path of git URLs in a file system-friendly representation.
For example:
- `[email protected]:user/some/nested/repo.git` -> `user/some/nested/repo`
- `https://example.com/user/repo` -> `user/repo`
The output can be used to `git clone` into directories corresponding to the server path
automatically, e.g. `git clone $1 $(this-script $1)`, where $1 is some git URL.
@alexpovel
alexpovel / lb.py
Created January 18, 2024 18:25
async-based leaky bucket implementation (multi-threaded-like). For fun and practice
import asyncio
import datetime
from collections import deque
from dataclasses import dataclass
from itertools import count
from typing import NewType
Request = NewType("Request", str)
SINK: list[Request] = []
@alexpovel
alexpovel / __main__.py
Last active January 3, 2024 22:05
Set Windows clipboard with rich content (respects e.g. formatting when processing)
import logging
import subprocess as sp
import typing as t
import win32clipboard as wcb # `pip install pywin32`
logging.basicConfig(level=logging.DEBUG)
# Found these manually via "InsideClipboard". Doesn't seem to be documented anywhere.
MS_TEAMS_HTML_FORMAT_ID = 49309
@alexpovel
alexpovel / .python-version
Last active March 10, 2024 07:23
qdrant proof of concept
3.11
@alexpovel
alexpovel / Dockerfile
Last active January 15, 2023 17:04
Converting mp4 videos (like lecture notes) to text (transcribing) using Python, its `speech_recognition` libs, and `openai/whisper`. Made reproducible via Docker.
FROM python:3.10.8-bullseye
RUN apt-get update && apt-get install --yes --no-install-recommends \
python3-pyaudio=0.2.11-1.3+b1 \
ffmpeg=7:4.3.5-0+deb11u1
# Alternatively, use git+https://github.com/openai/whisper.git
RUN pip install --no-cache-dir \
speechrecognition==3.9.0 \
whisper.ai==1.0.0.1
{
"valid-json": "but invalid schema"
}
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Alex Povel",
"label": "Software Engineer at Tiplu",
"email": "[email protected]",
"summary": "Highly driven, dependable and people-oriented backend software developer with proficiency in Python, git, Docker, Linux and Windows system administration, as well as the energy systems design and analysis domain. Bilingual (German, English).",
"location": {
"city": "Hamburg",
"countryCode": "DE",
@alexpovel
alexpovel / init.ps1
Last active June 2, 2023 08:39
Windows bootstrap Chocolatey installation script
choco install --timeout=0 --yes `
7zip `
audacity `
calibre `
cpu-z `
crystaldiskinfo `
delta `
directoryopus `
discord `
docker-desktop `