Skip to content

Instantly share code, notes, and snippets.

Elric Milon whirm

Block or report user

Report or block whirm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View crash_m2crypto.py
from M2Crypto import EVP
from binascii import hexlify, unhexlify
def long_to_bytes(val, nrbytes=0):
hex_val = '%x' % abs(val)
if nrbytes:
padding = '0' * ((abs(nrbytes) * 2) - len(hex_val))
else:
padding = ''
result = unhexlify(padding + hex_val)[::-1]
@whirm
whirm / autopep8.el
Created Jul 31, 2013
Clean up python code from Emacs.
View autopep8.el
;;; autopep8.el -- clean up python code
;
; based on js-beautify.el - http://sethmason.com/2011/04/28/jsbeautify-in-emacs.html
; Rescued from https://raw.github.com/tomscytale/autopep8/8792df48806eb3c9fb9d901529e4e967520e09c2/autopep8.el
;
; put this in your emacs init:
; (add-to-list 'load-path "~/dir/containing/autopep8/")
; (require 'autopep8)
;
; to use:
You can’t perform that action at this time.