Skip to content

Instantly share code, notes, and snippets.

@elzibubble
Last active March 8, 2016 11:35
Show Gist options
  • Save elzibubble/1c2fd446a6688c15b4f9 to your computer and use it in GitHub Desktop.
Save elzibubble/1c2fd446a6688c15b4f9 to your computer and use it in GitHub Desktop.
Utils for manual Python instrumentation
def foo(msg):
with open('foo.%d' % os.getpid(), 'a') as fp:
fp.write('%s\n' % msg)
FOO=0
def fin(msg):
global FOO
FOO += 1
foo('%s %s' % ('>'*FOO, msg))
def fox(msg):
global FOO
foo('%s %s' % ('<'*FOO, msg))
FOO -= 1
call setreg('q', "Ofin(\"%s.%s\" % ())\<ESC>mm?^class\<CR>0Wyw``F(a\"\<C-r>\"\", \"\"\<ESC>?def \<CR>wyw``P")
map Z Ypl2sox<ESC>dd}
@elzibubble
Copy link
Author

@elzibubble
Copy link
Author

rm -f foo_; tox -epy27 test_mutate_hook_process; for X in foo_; do echo "\n\n-- $X --"; cat $X; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment