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
function! BreakHere() | |
s/^\(\s*\)\(.\{-}\)\(\s*\)\(\%#\)\(\s*\)\(.*\)/\1\2\r\1\4\6 | |
call histdel("/", -1) | |
endfunction | |
nnoremap <key> :<C-u>call BreakHere()<CR> |
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 checker(code, restricted): | |
r = set(restricted) | |
c = set(code) | |
chars = {*'\t\n', *map(chr, range(32, 127))} | |
if c == chars - r: | |
print('Good to go!') | |
else: | |
if r & c: | |
print('Illegal characters: {}'.format(''.join(r & c))) | |
if chars - r - c: |
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
#!/usr/bin/env python | |
# liuw | |
# Nasty hack to raise exception for other threads | |
import ctypes # Calm down, this has become standard library since 2.5 | |
import threading | |
import time | |
NULL = 0 |