Skip to content

Instantly share code, notes, and snippets.

View arizvisa's full-sized avatar
🖕

Ali Rizvi-Santiago arizvisa

🖕
  • Everything here is BSD Licensed unless specified otherwise.
View GitHub Profile
@arizvisa
arizvisa / wrapper.py
Last active January 6, 2019 05:52
(Python2) properly wrapping a callable whilst retaining all information about the wrappee
import functools,operator,itertools,types,six
class wrap(object):
"""
A lot of magic is in this class which allows one to do a proper wrap
around a single callable.
"""
CO_OPTIMIZED = 0x00001
CO_NEWLOCALS = 0x00002
@arizvisa
arizvisa / .vimrc
Created July 31, 2015 04:07
auto-loading/saving a session to .vim.session
""" session auto-saving and things
"set sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize
if has("unix") || &shellslash | let s:pathsep = '/' | else | let s:pathsep = '\' | endif
let g:session_file = join([getcwd(),".vim.session"], s:pathsep)
if (argc() == 0) && empty(v:this_session) && filereadable(g:session_file)
let g:session = 1
else
let g:session = 0
endif