Skip to content

Instantly share code, notes, and snippets.

View ypoluektovich's full-sized avatar

Yanus Poluektovich ypoluektovich

View GitHub Profile
@ypoluektovich
ypoluektovich / akun.css
Created March 25, 2020 17:24
Fix some CSS kascode
.content .page-body .chapter .imgContainer {
height: auto !important;
}
@ypoluektovich
ypoluektovich / switch_vs_trait.rs
Created June 2, 2018 10:08
Rust/criterion benchmark about what's faster between field-based match and polymorphism
#[macro_use]
extern crate criterion;
use criterion::Criterion;
use std::ops::Index;
struct SerS {
kind: u8,
ptr: *const u8,
@ypoluektovich
ypoluektovich / nyaa2tm.py
Last active August 29, 2015 14:02
Parse a list of nyaa.se pages and tell transmission to download everything on them
from bs4 import BeautifulSoup
import requests
import sys
import os
from subprocess import call
import tempfile
if len(sys.argv) < 3:
print('Usage: $0 transmission_host urls...')
exit()
@ypoluektovich
ypoluektovich / lsic
Last active January 3, 2016 12:48
List rolls from invisiblecastle.com
#!/bin/bash
tehStart=0
tehEnd=0
LSIC_SPREAD=${LSIC_SPREAD:-50}
case "$#" in
"0" )
cat <<EOF
Usage:
@ypoluektovich
ypoluektovich / pack-logs.sh
Last active January 1, 2016 02:49
A script that packs pidgin/finch logs (run it in ~/.purple/logs) into .tar.xz archives, grouping the files by year
#!/bin/bash
for year in `seq 2009 2012`; do
echo "Processing year $year..."
LISTFILE="list-$year"
PACKFILE="logs-$year.tar.xz"
find . -name "$year-*" | sort >$LISTFILE
echo "Found $( cat $LISTFILE | wc -l ) files"
tar -c -T $LISTFILE | pv -c -N tar -pterab -s $( cat $LISTFILE | xargs du -bs | awk '{s+=$1} END {print s}' ) | xz | pv -c -N xz -trab >$PACKFILE
done