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
from functools import wraps, lru_cache | |
from contextlib import contextmanager | |
class _SkipCache(Exception): | |
def __init__(self, value): | |
self.value = value | |
class _CachedFunction(object): | |
def __init__(self, maxsize = 128, typed = False): | |
self.__is_skipped = 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
" Disable sections in C/C++ code using #if 0/#endif blocks. | |
" This uses <Leader>-i/e in normal/visual mode. In normal mode, it also takes a count (3<Leader>i to wrap 3 lines). | |
" The <Leader>-e option places the user inside the #else block. | |
function! s:wrap_disabling_if(num_lines) | |
execute "normal O#if 0" | |
execute "noraml " . a:num_lines . "j" | |
execute "normal o#endif" | |
endfunction |
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 | |
"""Git pre-commit hook to run pylint on python files. | |
To install: | |
wget https://gist.github.com/nivbend/7e0e306a98138916b3c9#file-run_pylint-py -O .git/hooks/pre-commit | |
""" | |
from __future__ import print_function | |
from subprocess import check_output, CalledProcessError | |
from sys import stderr |