Skip to content

Instantly share code, notes, and snippets.

View asm0dey's full-sized avatar

Pasha Finkelshteyn asm0dey

View GitHub Profile
@asm0dey
asm0dey / baibako.yml
Last active March 10, 2022 23:16
Flexget config, which helps to put series from different russian-languaged trackers to organized folder structure using deluge.Also here is filtering based on quality, usual replacements for qualities and episode numberingFinally, one can find here filtering based on content size
series:
h264:
- 'Downton Abbey':
alternate_name: 'Аббатство Даунтон'
- 'Bones':
alternate_name: 'Кости'
- 'Delirium':
alternate_name: 'Делириум'
- 'Gang Related':
alternate_name: 'Преступные связи'
@asm0dey
asm0dey / gist:8331623
Last active January 2, 2016 16:39
Little bottle server to download torrents from rutracker. requires bottle
# coding=utf-8
import requests
from argparse import ArgumentParser
from bottle import route, run, response
@route('/<id>.torrent')
def download_rutracker_torrent(id):
headers = {'referer': "http://rutracker.org/forum/viewtopic.php?t=" + id,
"Content-Type": "application/x-www-form-urlencoded", "t": id}
@asm0dey
asm0dey / RWLock.java
Last active December 9, 2018 12:07
naive ReadWriteLock realization
import java.util.function.Supplier;
public class RWLock {
private final ReadLock readLock = new ReadLock(this);
private final WriteLock writeLock = new WriteLock(this);
final Object globalLock = new Object();
public void lockRead() {
readLock.lock();
xlc::;'.';:;;;;;;::::,';;,;;;,;;;;,;:;,;;;;,,,;;;,'',::,'',,;;,'',',;,,:cc;''','
l:,,,;;;;:cllc;;;::::,',,',::;:::::;:;,,;::;,;;::,,,''',;,'.''''''.''',:;;,,;;,,
c:;:cc:::cldkOxc:::::;,;::::;,''';:;;;::,,'',',,,,;,',,......''....''';;,,,','''
,,;::::::lxO00K0xc:::;,,;;;;,'...',;clc:;,'',,,;;,''..........';cdxkkddo:'''''''
;,,,;;;:lxKKKKKKK0o,......',,''..';;:lcc::;,'',;;;'''.......'lk00KXK0dll:,'','..
''',,''lkOolokOO0KK0xc;:c:::::::;:;::cc:;;;::c::::;',,'...,dKXNXXXKXKO:.','':;''
;;;;;,:dOl::coxkkxk0XKkc:::;,,,,',;,,;ol,,,,,,,,:;:codddO0NXK000kolok0d'.',';;',
,,,,,,ckxllcccoxkkdokd;'',,,::::cldkkdOkxlc;:::;,',,,;d0XK0kkOkdc;;clkx;..''',,'
''''';oOdollc:clxkkdo:'';cdxxOK00KKXKXKK00OK00OOo:;;,';xxxxkkdl:;:cllxOc,;;;:;,'
''.'',lOolcc:::ldxkxo::;;:lloxk0000K0XXXK00000dl:;,,;;;ldxxdoc:;;:cclxko:,;;;,;;
@asm0dey
asm0dey / Iterables.es6.js
Last active March 6, 2016 10:14
Simple library with lazy es6 iterables. If you use es5 - don't forget to add es5 polyfill
function range(start, finish, step = 1) {
if (step < 1) throw "Step must be ge 1"
return {
[Symbol.iterator]: function* () {
let count = 1;
yield start
if (start !== finish) {
let tmp = start;
if (start < finish) {
while (tmp < finish) {
@asm0dey
asm0dey / Lib.hs
Last active November 3, 2015 20:36
Chess problem solution in Haskell
module Lib
( someFunc
) where
import Data.Maybe
import Data.Either
import Data.Foldable
import Data.Sequence
import Data.Set
@asm0dey
asm0dey / ClientFactory.java
Last active August 26, 2016 06:28
Simple processor, which goes thru interfaces, which are annotated with @RequestMapping annotation and creates interfaces from them
package ru.atol.asmcloud.apt.processor;
import com.squareup.javapoet.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.client.RestTemplate;
import javax.lang.model.element.Element;

Keybase proof

I hereby claim:

  • I am asm0dey on github.
  • I am asm0dey (https://keybase.io/asm0dey) on keybase.
  • I have a public key ASCzpuDcSOOc319ruK9VOnasGUz_I8mdSa6lT9JO7WmZhwo

To claim this, I am signing this object:

@asm0dey
asm0dey / install_peerflix.sh
Last active June 30, 2018 19:55 — forked from abakum/install_peerflix
Use peerflix for kodi@OSMC on raspberry Pi
#!/bin/bash
mkdir -p ~/ins
cd ~/ins
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
sudo npm install -g peerflix
package some;
import java.util.*;
import java.util.stream.Stream;
import static java.lang.Integer.parseInt;
import static java.util.Collections.singletonList;
import static java.util.Locale.ENGLISH;
public class Solver {