Skip to content

Instantly share code, notes, and snippets.

View notpushkin's full-sized avatar
🕊️

Alexander Pushkov notpushkin

🕊️
View GitHub Profile
const mapping =
"S......S..S.S......SSSS.T..S.SSTS..S.S...S...S.....S..SS.........SS..S...S...S...........SS....S.........SS............T...T......S....SS.S......STS...T........S.S........S..S..S......S.....S........S..S.S......................S.S..........S...............................SSSSS..SSS...SSSS..SS...........................T...........S....TS.........S.S................................T...............T.........S..S.SSSSSS.S.........T..........TT.............................T..S..S.SSS..S..................T.....T..T.T.....T.........................T..............S...S..........T..................................S.......TT.....S.TSS.................T....T.TT...........S.SSS...T.T...TTT.T......T...T..T...T.......T...................T..T................T......T.T.T...TT......T...TT..T......T..........T.......T....T..TTT..S............T....ST...ST..S............T.T......S..SS....S.S.S...S...S.TS.T.S............S.SS.....S.......T....S..SS.S.....S....S...S.S..S..ST.S.S.........ST...S...S......S.S.S.T..
@notpushkin
notpushkin / oathtool.py
Last active April 15, 2025 09:37
Minimal oathtool(1) reimplementation in Python
#!/usr/bin/env python3
# (c) 2025 Alexander Pushkov <pyoathtool@ale.sh>
# Based on https://github.com/susam/mintotp, copyright (c) 2019 Susam Pal
# SPDX-License-Identifier: MIT
import argparse
import base64
import hmac
import struct
import time
@notpushkin
notpushkin / rm-with-unordered-flags.sh
Created March 4, 2025 06:15
A shell function that wraps rm and re-orders flags in a way compatible with BSD platforms.
# SPDX-License-Identifier: Unlicense
rm() {
local flags=()
local args=()
for arg in "$@"; do
if [[ $arg == -* ]]; then
flags+=("$arg")
else
services:
app:
image: docuseal/docuseal:latest
networks: [default, traefik-public]
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.${PROJECT_NAME?}-http.rule=Host(`${DOMAIN?}`)
@notpushkin
notpushkin / msgspec_recurse.py
Last active September 2, 2024 23:57
Recursive conversion for msgspec
from typing import Any, Final
import msgspec
from msgspec import inspect
class _RecurseMarker:
def __repr__(self):
return "RECURSE"
{
"meta": {
"theme": "professional"
},
"basics": {
"name": "Alexander Pushkov",
"label": "Full-Stack Developer",
"summary": "I’m a versatile full-stack developer with a diverse background in various industries. I prioritize intuitive interfaces and thoughtful interactions in my development process and strive to ship software that users will love.",
"email": "alexander@notpushk.in",
"location": {
swagger: '2.0'
info:
title: Authzed
version: '1.0'
contact:
name: Authzed, Inc.
url: https://github.com/authzed/api
email: support@authzed.com
license:
name: Apache 2.0 License
@notpushkin
notpushkin / README.md
Last active March 25, 2025 06:44
dman on macOS – read man pages from manpages.debian.org

dman is now compatible with macOS/FreeBSD. Huge thanks to @stokito for helping upstream this patch!

curl https://salsa.debian.org/debian/debian-goodies/-/raw/master/dman?ref_type=heads > ~/.local/bin/dman
from fastapi import FastAPI, Depends
from contextlib import asynccontextmanager, contextmanager
app = FastAPI()
@contextmanager
def get_answer():
yield 42
@notpushkin
notpushkin / navigation.ts
Created April 6, 2023 13:07
svelte-compat
// https://kit.svelte.dev/docs/modules#$app-navigation
import { goto as routifyGotoStore } from "@roxi/routify";
import type { GotoHelper } from "@roxi/routify";
let routifyGotoHelper: GotoHelper | null = null;
/**
* Returns a subset of https://kit.svelte.dev/docs/types#public-types-page.
*/