To test:
>>> from underhanded import login
>>> login("l3viathan", "12345678")
0| function pickRandomProperty(obj) { | |
| // from http://stackoverflow.com/questions/2532218/pick-random-property-from-a-javascript-object | |
| var result; | |
| var count = 0; | |
| for (var prop in obj) | |
| if (Math.random() < 1/++count) | |
| result = prop; | |
| return result; | |
| } |
| (fn y=>(fn x=>(print(x^y^x^y))))(implode[chr(34)])"(fn y=>(fn x=>(print(x^y^x^y))))(implode[chr(34)])" |
| #!/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 |
| \clubpenalty = 10000· | |
| \widowpenalty = 10000· | |
| \displaywidowpenalty = 10000 | |
| \setlength\parindent{2.5em} | |
| \setlength\parskip{0.3\baselineskip}· | |
| \usepackage{geometry} | |
| \addtolength{\oddsidemargin}{.3in} |
| [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). |
| 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 |
| 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''' |
| license: gpl-3.0 |
| def weighted_distance(x, y): | |
| x, y = x.split(), y.split() | |
| length = len(x+y)/2 | |
| return editdistance.eval(x, y)/length |