Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇦
<3

Alexander Pushkov notpushkin

🇺🇦
<3
View GitHub Profile
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 Nov 6, 2022
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 Jun 22, 2022
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('---------')
View backlit.sh
#!/bin/bash
# Wrapper for brightnessctl, adding:
# - custom maximum value (useful when you override PWM settings)
# - smooooooooooooooooooooooooooooooooothiness
# - desktop notification
#
# Author: Alexander Pushkov <backlit@ale.sh>
# SPDX-License-Identifier: Apache-2.0 OR ISC
DELTA=2
View stderr
$ flatpak run -vv com.github.suzie97.communique 2>&1 | gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }'
[2021-09-04 18:05:37] F: No installations directory in /etc/flatpak/installations.d. Skipping
[2021-09-04 18:05:37] F: Opening system flatpak installation at path /var/lib/flatpak
[2021-09-04 18:05:37] F: Opening user flatpak installation at path /home/ale/.local/share/flatpak
[2021-09-04 18:05:37] F: Opening user flatpak installation at path /home/ale/.local/share/flatpak
[2021-09-04 18:05:37] F: Opening system flatpak installation at path /var/lib/flatpak
[2021-09-04 18:05:37] F: Opening user flatpak installation at path /home/ale/.local/share/flatpak
[2021-09-04 18:05:37] F: Opening system flatpak installation at path /var/lib/flatpak
[2021-09-04 18:05:37] F: /var/lib/flatpak/runtime/io.elementary.Platform/x86_64/6/f6458cfe79a53d649c33716c75262c1a2027121f0290b529644adee9a809d39e/files/lib32 does not exist
[2021-09-04 18:05:37] F: Cleaning up unused container id 3669369054
View README
An SSH key to connect to GitLab.com. Can read any public repos.
Public counterpart (feel free to add to your Git hostings as well):
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDFlf7wWgBodc2IAnKweYK6qXR81h7S/6+FUkugxvuTm
View openpgp.md