Skip to content

Instantly share code, notes, and snippets.

View notpushkin's full-sized avatar
🕊️

Alexander Pushkov notpushkin

🕊️
View GitHub Profile
@notpushkin
notpushkin / dman.sh
Last active December 26, 2023 11:55
dman on macOS – read man pages from manpages.debian.org
#!/bin/sh
set -e
# dman - read man pages from manpages.debian.org
# Patched for macOS by Alexander Pushkov <alexander@notpushk.in>
###############################################################################
# Copyright (C) 2008 Canonical Ltd.
#
# This code was originally written by Dustin Kirkland <kirkland@ubuntu.com>,
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.
*/
/* ==UserStyle==
@name WaniKani spacier reviews
@namespace wanikani-spacier-reviews@ale.sh
@version 1.0.0
@author Alexander Pushkov (hey@ale.sh)
==/UserStyle== */
@-moz-document domain("wanikani.com") {
:root {
--color-quiz-srs-correct-background: var(--color-quiz-correct-background);
.tabbrowser-tab {
--tab-corner-rounding: 30px;
--toolbar-color: transparent;
overflow: visible !important;
}
/* Fix left curve display on first tab */
#tabbrowser-arrowscrollbox:not([overflowing="true"]) .titlebar-spacer {
margin-inline-end: -15px;
#!/bin/bash
# 2022 Alexander Pushkov, licensed ISC
# Usage: gptman curl in humorous style
set -e
OPENAI_API_KEY='...'
mandir="$(mktemp -d gptman.XXXXXX)"
trap "rm -rf ${mandir}" EXIT HUP INT QUIT TERM
man="${mandir}/page"
#!/bin/bash
# WTFPL
tsp=(/opt/homebrew/bin/tailscale --socket ~/.tailscaled.socket)
jq() {
/opt/homebrew/bin/jq "$@"
}
status_json="$("${tsp[@]}" status --json)"
<script lang="ts">
import ApexCharts from "apexcharts";
let chartCpu: HTMLDivElement | null;
$: if (chartCpu) {
new ApexCharts(chartCpu, {
// styling
chart: {
type: "area",
/* ==UserStyle==
@name Clean style for Ozon homepage
@namespace ozon-sanity@ale.sh
@version 1.0.0
@author Alexander Pushkov (hey@ale.sh)
==/UserStyle== */
@-moz-document url("https://www.ozon.ru/") {
.container,
[data-widget="paginator"] {
from wemake_python_styleguide.violations import system, naming, complexity, consistency, best_practices, refactoring, oop
REDIR_TEMPLATE = "/{full_code} https://wemake-python-styleguide.readthedocs.io/en/latest/pages/usage/violations/{group_name}.html#{full_group_name}.{name}"
violation_groups = {
"system": system,
"naming": naming,
"complexity": complexity,
"consistency": consistency,