Skip to content

Instantly share code, notes, and snippets.

Avatar
🕊️
<3

Alexander Pushkov notpushkin

🕊️
<3
View GitHub Profile
@notpushkin
notpushkin / navigation.ts
Created April 6, 2023 13:07
svelte-compat
View navigation.ts
// 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.
*/
View wanikani-spacier-reviews.user.css
@-moz-document domain("wanikani.com") {
:root {
--color-quiz-srs-correct-background: var(--color-quiz-correct-background);
}
.character-header__menu,
.character-header__characters {
margin-bottom: var(--spacing-xxxloose);
}
View australis-for-lepton.userChrome.css
.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;
View gptman.sh
#!/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"
View xbar-tailscale.10s.sh
#!/bin/bash
# WTFPL
tsp=(/opt/homebrew/bin/tailscale --socket ~/.tailscaled.socket)
jq() {
/opt/homebrew/bin/jq "$@"
}
status_json="$("${tsp[@]}" status --json)"
View tabler-apexcharts.svelte
<script lang="ts">
import ApexCharts from "apexcharts";
let chartCpu: HTMLDivElement | null;
$: if (chartCpu) {
new ApexCharts(chartCpu, {
// styling
chart: {
type: "area",
View ozon-sanity.user.css
@-moz-document url("https://www.ozon.ru/") {
.container,
[data-widget="paginator"] {
display: none;
}
#stickyHeader {
flex-direction: column;
gap: 3em;
margin-block: 3em;
View we_make_redirects.py
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,
@notpushkin
notpushkin / outline-keygen.sh
Last active November 6, 2022 14:54
Outline VPN server stack adapted for use with Lunni / Docker Swarm
View outline-keygen.sh
#!/bin/bash
set -euo pipefail
fb="$(tput bold)"
fn="$(tput sgr0)"
log() {
echo "$1" > /dev/stderr
}
@notpushkin
notpushkin / tic_tac_toe.py
Last active June 22, 2022 05:37
A tic-tac-toe game, (almost) implemented by GitHub Copilot
View tic_tac_toe.py
# Prompt:
"""A tic-tac-toe game."""
# Everything down below is autocompleted:
def print_board(board):
"""Prints the board."""
print(board[0] + ' | ' + board[1] + ' | ' + board[2])
print('---------')