A python library for corrupting text and binaries.
Arguments:
import sys | |
from ast import * | |
module=Module(body=[FunctionDef(name='square',args=arguments(args=[arg(arg='x',annotation=None,lineno=1,col_offset=1)],vararg=None,kwonlyargs=[],kw_defaults=[],kwarg=None,defaults=[],lineno=1),body=[Return(value=BinOp(left=Name(id='x',ctx=Load(),lineno=1,col_offset=1),op=Pow(),right=Num(n=2,lineno=1,col_offset=1),lineno=1,col_offset=1),lineno=1,col_offset=1)],decorator_list=[],returns=None,lineno=1,col_offset=1)]) | |
modobj=type(sys)(__name__) | |
exec(compile(module,"<ast>","exec"),None,modobj.__dict__) | |
sys.modules[__name__]=modobj |
import teambot, tasks, time, re | |
NICK = "" | |
NS_PASS = "" | |
VAULT = "" | |
CHANNELS = [] | |
REDEEM_FAILURE = re.compile(r"Please wait (\d+m )?(\d+s)") | |
REDEEM_SUCCESS = re.compile(r"Redeemed ([0-9.]+) coins") | |
MESSAGE_FORMAT = re.compile(r"\S+ flips heads and (wins|loses) [0-9.]+ coins! \(new total: ([0-9.]+)\)") |
#!/usr/bin/env python3 | |
import requests, argparse, configparser, os.path, json | |
config = configparser.ConfigParser() | |
config.read(os.path.expanduser("~/.config/github.ini")) | |
creds = config["credentials"] | |
def read_file(fn): | |
with open(fn) as f: return dict(content=f.read()) |
import sqlite3, csv, sys, re | |
DIGIT = re.compile("0([box])(\d+)") | |
def get_type(s): | |
if s.isdigit(): return "INTEGER", int | |
m = DIGIT.match(s) | |
if not m: return "TEXT", str | |
base, num = m.groups() | |
if base=="x": return "INTEGER", lambda x: int(x,16) | |
elif base=="o": return "INTEGER", lambda x: int(x,8) |
import csv,sys | |
assert len(sys.argv) in (2,3),"Usage: csv2md.py <input_file> [output_file]" | |
# assumes top row is table headers | |
with open(sys.argv[1]) as f: rows = list(csv.reader(f)) | |
max_row_length = max(*[len(r) for r in rows]) | |
for row in rows: |
#!/usr/bin/python3 | |
import argparse | |
# This is the list of words that will be used to search for the word. | |
# Format is one word per line. | |
# The script will ignore lines starting with a hash. | |
WORDLIST = "/usr/share/dict/words" # default word list on most Linux boxen | |
def str_sorted(word): | |
"""Returns a string with sorted characters.""" |
function MRANK(value,values) { | |
var values = values.map(function(x) { return x[0]; }); // apparently I misjudged how Google Sheets passes values. Why is it like this?!?! | |
var valuesSorted = values.sort(function(a,b){ return b-a; }); | |
var valuesUnique = valuesSorted.filter(function(value,index,self) { return self.indexOf(value) === index; }); | |
var index = valuesUnique.indexOf(value); | |
if (index<0) { | |
throw("MRANK has no valid input data"); | |
} | |
return index+1; | |
} |
local function _W(f) local e=setmetatable({}, {__index = _ENV or getfenv()}) if setfenv then setfenv(f, e) end return f(e) or e end | |
print("BASIC interpreter?") | |
print("Programmer lazy.") | |
print("Understandable, have a great day!") |