Skip to content

Instantly share code, notes, and snippets.

@ryanpetrello
ryanpetrello / gist:6626ae4fe1e20ce651e3e83f677dc602
Last active October 18, 2016 03:18
Potential Python 3.5 signal.signal regression?
$ python2 --version && python3.4 --version && python3.5 --version
Python 2.7.11
Python 3.4.4
Python 3.5.1
$ cat alarm.py
import signal
import time
def receive_alarm(signum, stack):
@ryanpetrello
ryanpetrello / gist:8397a8b71c1406112482bd008d70c1b6
Last active February 5, 2019 19:30
git blame for current line
" -- git blame for current file
function! GitBlame()
let sha = matchstr(system('git --no-pager blame '.expand('%').' -L '.line('.').',+1'), '^\^*\zs\S\+')
let command = join(map(split('git show '.sha), 'expand(v:val)'))
let winnr = bufwinnr('git.blame')
silent! execute winnr < 0 ? 'botright new ' . 'git.blame' : winnr . 'wincmd w'
setlocal buftype=nowrite bufhidden=wipe nobuflisted noswapfile nowrap number filetype=diff
silent! execute 'silent %!'. command
silent! execute 'nnoremap <silent> <buffer> q :q! <CR>'
endfunction

Keybase proof

I hereby claim:

  • I am ryanpetrello on github.
  • I am ryanpetrello (https://keybase.io/ryanpetrello) on keybase.
  • I have a public key ASC6lll9knTfAYUfm6vvImbKmCzQkqgQSNCgajfBSZJRfAo

To claim this, I am signing this object: