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 site | |
if len(sys.argv) == 1: | |
del os.environ['PYTHONSTARTUP'] | |
sys.path.append(site.USER_SITE) | |
try: | |
if 'IPython' in sys.modules: |
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 sys | |
BLACK = 0 | |
RED = 1 | |
GREEN = 2 | |
YELLOW = 3 | |
BLUE = 4 | |
MAGENTA = 5 | |
CYAN = 6 |
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 typing | |
import inspect | |
import functools | |
def strict_types(func: typing.Callable): | |
"""Decorator for enforcing strict type annotations""" | |
argspec = inspect.getfullargspec(func) | |
ret_type = argspec.annotations.pop('return', 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
" Requires 'timeoutlen' to be low enough for this to be practical: | |
" set timeoutlen=100 | |
function! s:relative_number_op(key) abort | |
let old_rn = &l:relativenumber | |
let &l:relativenumber = 1 | |
redraw | |
let seq = a:key | |
while 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
if !has('nvim') | |
finish | |
endif | |
let s:path = expand('<sfile>:p:h') | |
let s:target = 'all' | |
let s:error_path = s:path.'/tmp/errors.json' | |
let s:errors_url = 'https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json' | |
let g:neomake_make_maker = { |
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
highlight default NonComment ctermfg=8 ctermbg=none cterm=none guifg=#333333 guibg=none gui=none | |
function! s:toggle_comments() abort | |
if exists('w:toggle_comments') | |
silent! call matchdelete(w:toggle_comments) | |
unlet! w:toggle_comments | |
else | |
let w:toggle_comments = matchadd('NonComment', '^\%(\s*'.split(escape(&commentstring, '^$.*/"'''), '%s')[0].'\)\@!.*') | |
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
#!/bin/sh | |
# Script for compiling Python 2.7.9 on Ubuntu 14.04 LTS and installing it to /usr/local | |
# * Source files are downloaded and left at /usr/local/src | |
# * Uses checkinstall to generate a deb package, so it will take a while. | |
# * Can be uninstalled using 'dpkg -r private-compiled-python2.7' | |
# * Uncomment line 57 if you *don't* want to install virtualenv and supervisor | |
# * Gists will be downloaded if supervisor's conf or init script doesn't exist. | |
# * You'll need to add /usr/local/bin to your PATH if it's not already | |
ohshi() |
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
#!/bin/sh | |
# This is a quick script to download and install Oracle's Java 8 Server JRE | |
# It was made with Ubuntu 14.04 LTS in mind, and installs to /usr/local | |
# curl pipe this script to sh if you enjoy the thrill of getting into an internet stranger's van | |
prefix="/usr/local" | |
java_url="http://download.oracle.com/otn-pub/java/jdk/8u45-b14/server-jre-8u45-linux-x64.tar.gz" | |
dl_file="/tmp/oracle-java8.tar.gz" | |
ohshi() |
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
# This illustrates how ridiculous python functions can get. | |
# It is far from a common way to write functions. | |
# Though, I've seen comments inside of multiline arguments | |
# in the stdlib modules. | |
def hello \ | |
( # This starts the hello function | |
arg1, # This is arg1 | |
# I'm an extra comment |
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
#!/bin/bash | |
# Generate xterm-256color and screen-256color terminfo files that supports | |
# italicized text and standout display style. This will override the system's | |
# descriptions of xterm-256color and screen-256color for your shell. | |
# | |
# To enable in tmux: | |
# set -g default-terminal "xterm-256color" | |
# | |
# tmux recommends creating an `tmux-256color` terminfo file and setting the | |
# default-terminal to "xterm", but this causes ssh sessions to not display |
NewerOlder