Skip to content

Instantly share code, notes, and snippets.

View Xifax's full-sized avatar

Artiom Basenko Xifax

  • St. Petersburg
View GitHub Profile
@Xifax
Xifax / scan_and_replace.py
Last active February 16, 2023 12:29
Quick and dirty cleanup script for Anki
"""
Scan and remove Anki notes from specified decks.
Run from '.../Anki2/User 1/this_script.py'
Resources in ./jlpt/*
15000k
https://github.com/hingston/japanese
JLPT
https://gist.github.com/nakaly/c2c855766ce1661e11396b09760b9598
"""
@Xifax
Xifax / config.lua
Created November 3, 2022 13:04
.config/lvim
--[[
lvim is the global options object
Linters should be
filled in as strings with either
a global executable or a path to
an executable
]]
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
@Xifax
Xifax / places.txt
Last active July 28, 2022 12:30
2Gis export
Cafe 11 [кофейня]
​Невский проспект, 64
​Дворцовый, Центральный район, Санкт-Петербург
Кофе на кухне [кофейня]
​набережная реки Фонтанки, 17
​Дворцовый, Центральный район, Санкт-Петербург
Solaris lab [кофейня]
​Курляндская, 49
@Xifax
Xifax / anifi
Last active November 6, 2021 10:54
Play anime and game radio stations using mpv
#!/usr/bin/env bash
CHOICE=$(whiptail --title "Station" --menu "Make your choice" 18 50 10 \
"1" "Anison.fm" \
"2" "r-a-d.io" \
"3" "VGM Radio" \
"4" "Rainwave Game" \
"5" "Rainwave Chiptune" \
"6" "Rainwave All" \
"7" "Kohina" \
@Xifax
Xifax / lofi.sh
Last active November 16, 2023 23:05
Updated script for playing different lofi stations (MacOS)
#!/bin/sh
# Requires https://formulae.brew.sh/formula/choose
# Requires https://formulae.brew.sh/cask/mpv
# Chmod +x lofi.sh and put it somewhere in $PATH
# May also set global hotkey via https://github.com/koekeishiya/skhd
# e.g. echo "ctrl + cmd - p : ~/lofi" >> ~/.skhdrc
notification() {
terminal-notifier -message 'Now Playing: Lofi Radio ☕️🎶'
@Xifax
Xifax / onomato.py
Created July 14, 2020 17:12
Quick and dirty parser for onomatoproject. Compiles list of JP onomatopeia, dumps to json and downloads relevant images.
"""
Parse https://onomatoproject.com/list.html to json dict and download images.
"""
from typing import Dict, Tuple
import requests
from bs4 import BeautifulSoup
from pathlib import Path
import json
@Xifax
Xifax / .vimrc
Created April 9, 2020 13:15
Lightweight vimrc with spellcheck (ru)
" Installation
"
" curl -L https://gist.github.com/xifax/45a062456d9f42cea6c07745ad6f009b/raw/.vimrc --output ~/.vimrc
"
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
set nocompatible
filetype plugin on
call plug#begin('~/.vim/plugged')
@Xifax
Xifax / app.py
Last active October 11, 2018 10:59
Вопросы в todo и дополнительном файле
import os
import re
from collections import Counter
import fulltext
from flask import Flask, jsonify, render_template
app = Flask(__name__)
# TODO: Что можно использовать вместо global?
extension_file = None # if the user wants a special extension
@Xifax
Xifax / functional_tasks.md
Last active August 8, 2018 07:50
Варианты задачек

Проверка на числа Армсторнга

Число Армстронга — натуральное число, которое в данной системе счисления равно сумме своих цифр, возведённых в степень, равную количеству его цифр.

К примеру:

@Xifax
Xifax / Vagrantfile
Last active August 3, 2018 08:45
Vagrant image for Ubuntu 16.04 with docker and kubernetes + GUI options and other paraphernalia
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
# alternative box
# config.vm.box = "bento/ubuntu-16.04"
# create this folder on host machine before 'vagrant up'
config.vm.synced_folder "./repos", "/home/vagrant/repos"
config.vm.network "forwarded_port", guest: 80, host: 8080