To test:
>>> from underhanded import login
>>> login("l3viathan", "12345678")
0| Copyright (c) 2018 L3viathan | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all |
| def retry(tries): | |
| def decorator(fn): | |
| @functools.wraps(fn) | |
| def wrapper(*args, **kwargs): | |
| ex = None | |
| for i in range(tries): | |
| try: | |
| result = fn(*args, **kwargs) | |
| except Exception as e: | |
| print("Failed...") |
| def weighted_distance(x, y): | |
| x, y = x.split(), y.split() | |
| length = len(x+y)/2 | |
| return editdistance.eval(x, y)/length |
| license: gpl-3.0 |
| import operator as op | |
| from functools import partial | |
| class _getter(object): | |
| def __init__(self, *, is_original=True): | |
| self.is_original=is_original | |
| self.__ops = [] | |
| def __call__(self, something): | |
| ''' Maybe eventually extend to act like methodcaller, but problems exist''' |
| import random | |
| import math | |
| class Num(object): | |
| def __init__(self, val): | |
| self.value = val | |
| self.bit = False | |
| def __repr__(self): | |
| return str(self.value) | |
| def __abs__(self): | |
| return self |
| [version 1.1] | |
| Chatting happens in different levels, which allows for multi-threaded conversations. | |
| The different conversation levels are marked with a number of parantheses. | |
| Example 1: | |
| A: How are you? | |
| A: (And how is your family?) | |
| B: Fine (and fine, too). |
| \clubpenalty = 10000· | |
| \widowpenalty = 10000· | |
| \displaywidowpenalty = 10000 | |
| \setlength\parindent{2.5em} | |
| \setlength\parskip{0.3\baselineskip}· | |
| \usepackage{geometry} | |
| \addtolength{\oddsidemargin}{.3in} |
| #!/bin/sh | |
| # Get stream URLs for the second episode of the seventh season of futurama: | |
| # kinox.sh futurama 7 2 | |
| # for shows with spaces, insert a plus sign instead: | |
| # kinox.sh it+crowd 3 1 | |
| # grab the stream by searching for the show on kinox.to, filtering to only show english versions, and extracting the internal show name | |
| export stream_page=$(curl -sL "http://kinox.to/Search.html?q=$1" | pcregrep -M 'lng\/2\.png(\n|.)+?class="Title"' | pcregrep -o1 'Stream\/(.+?)\.html' | head -n 1) | |
| # get the show's page, with the undocumented additional parameters for season and episode, and grab the "rel" attribute of the hoster list |