Skip to content

Instantly share code, notes, and snippets.

View kvoss's full-sized avatar

K. Voss kvoss

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kvoss on github.
  • I am kvoss (https://keybase.io/kvoss) on keybase.
  • I have a public key ASDcEdWWsNrCl-j-_ieVWUqT_eQSp2R_kB38f5XNBrIXeAo

To claim this, I am signing this object:

augroup txtdocs
au!
au BufEnter *.txt,*.rst,*.md,*.tex
\ setlocal spell spelllang=en_ca |
\ highlight FuzzyWords ctermfg=red |
\ match FuzzyWords /\<[Ss]ome\>\|\<[Mm]any\>\|\<[Vv]ery\>\|\<[Rr]eally\>\|\<[Tt]hing\>\|\<[Ii]n fact\>\|\<[Aa]ctually\>\|\<[Aa] lot of\>\|\<[Tt]ruly\>/
au BufEnter *.txt,*.rst,*.md,*.tex
\ highlight TiredWords ctermfg=red |
\ match TiredWords /like\|nice\|great\|amazing\|quite\|interesting\|beautiful\|awesome\|feel\|kind of\|sort of/
@kvoss
kvoss / sthfunc.py
Created December 12, 2013 07:53
Python: something functional
def zipWith (f, xs, ys):
lf = lambda (a,b) : f(a,b)
args = zip (xs, ys)
rs = map (lf, args)
return rs
def compose (fs):
@kvoss
kvoss / MutedOutput.py
Created December 5, 2012 04:00
buggy output capturing
class MutedOutput(object):
def __init__(self):
self.null_fds = [os.open(os.devnull, os.O_RDWR) for _ in xrange(2)]
self.savd_fds = None
self.pipe = os.pipe() # (r, w) FDs tuple
def __enter__(self):
self.savd_fds = os.dup(1), os.dup(2)
#os.dup2(self.null_fds[0], 1)
os.dup2(self.pipe[1] , 1)
@kvoss
kvoss / hello.m
Created November 21, 2012 00:25
alloc problem
#import <objc/Object.h>
#import <stdio.h>
@interface Number: Object
{
@public
int number;
}
- (void) printNum;