This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set conceallevel=2 | |
syntax match Normal '\v ?(:|-\>) ?[^,):]+' conceal | |
" this doesn't always work, only with simple types (not stuff with commas in them) | |
" if you know how to deal with those (virtual text?), tell me please |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for type( | |
type.__name__, | |
(), | |
{ | |
type.__name__: type( | |
type.__name__, | |
(), | |
{ | |
"__{0}__".format( | |
type({0}).__name__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fishhook | |
split_map = {"w": "v"} | |
@fishhook.hook(str) | |
def __getitem__(self, something): | |
if not isinstance(something, slice): | |
return fishhook.orig(self, something) | |
start, stop, step = something.start, something.stop, something.step | |
split_start = start % 1 == 0.5 if start else False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import inspect | |
import signal | |
from contextlib import contextmanager | |
def _kill_self(signum, frame): | |
os._exit(0) | |
@contextmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AliasableMeta(type): | |
aliases = {} | |
class Aliasable(metaclass=AliasableMeta): pass | |
class AliasOfMeta(type): | |
def __getattr__(self, value): | |
return self(value) | |
class alias_of(metaclass=AliasOfMeta): | |
def __init__(self, other=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import mutable_tuples | |
>>> t = (1, 2, 3) | |
>>> t[1] = 23 | |
>>> t | |
(1, 23, 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec("\n".join(l[:len(l)//2+1].strip().replace("X"," "*4)for l in"""ni l rof)4*" ","X"(ecalper.)(pirts.]1+2//)l(nel:[l(nioj."n\"(cexe | |
import sysys tropmi | |
for l in sys.stdin.readlines():)(senildaer.nidts.sys ni l rof | |
XL=l.rstrip("\\n");print(L==L[::-1])]1-::[L==L(tnirp;)"n\\"(pirtsr.l=LX | |
))]1-:1[)"n\"(tilps.""".split("\n")[1:-1])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-moz-document domain("tagesschau.de") { | |
.teasergroup { | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.teaser:not(.teaser--top) { | |
flex-basis: 50%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{xparse} | |
\ExplSyntaxOn | |
\NewExpandableDocumentCommand{\cmidrulez}{m} | |
{ | |
\noalign { \__leviathan_cmidrulez:n { #1 } } | |
\tl_use:N \g__leviathan_cmidrulez_tl | |
} | |
\tl_new:N \g__leviathan_cmidrulez_tl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def redoable(iterable): | |
do_redo = False | |
def redo(): | |
nonlocal do_redo | |
do_redo = True | |
for item in iterable: | |
yield redo, item | |
while do_redo: | |
do_redo = False | |
yield redo, item |