Skip to content

Instantly share code, notes, and snippets.

Mike Ivanov mikeivanov

View GitHub Profile
View startswank.lisp
(in-package swank)
(setq swank-debugger-hook-orig #'swank-debugger-hook)
(defun swank-debugger-hook (condition hook)
(etypecase condition
(sb-int:simple-stream-error
(progn
(princ "*** Stream error" *error-output*)
(abort)))
@mikeivanov
mikeivanov / contextsearch.el
Created Apr 2, 2012
Duckduckgo the term under cursor
View contextsearch.el
(defun search-selection-or-symbol (arg)
(interactive "p")
(unless (and (local-variable-p 'search-prefix-default)
search-prefix-default)
(let* ((mode (symbol-name major-mode))
(name (replace-regexp-in-string "-mode$" "" mode))
(prefix (replace-regexp-in-string "-" " " name)))
(set (make-local-variable 'search-prefix-default) prefix)))
(let* ((prefix (if (= arg 1)
search-prefix-default
@mikeivanov
mikeivanov / paillier.py
Created Jun 29, 2011
Pure Python Paillier Homomorphic Cryptosystem
View paillier.py
import math
import primes
def invmod(a, p):
'''
http://code.activestate.com/recipes/576737-inverse-modulo-p/
The multiplicitive inverse of a in the integers modulo p.
Return b s.t.
a * b == 1 mod p
'''
You can’t perform that action at this time.