Skip to content

Instantly share code, notes, and snippets.

View karbiv's full-sized avatar

Alexandr Karbivnichiy karbiv

  • Kishinau, Moldova
View GitHub Profile
@romainl
romainl / vanilla-surround.md
Last active November 13, 2024 17:53
Poor man's Surround

Poor man's Surround

The following shows how to replicate some of Surround's features if you don't happen to have it installed.

NOTE: We only dealt with the simplest cases, here, and the convoluted nature of some of these commands shows how well designed and useful that plugin is. And let's not talk about all the corner cases it handles.

Install it, it's worth it.

The list

@guicho271828
guicho271828 / characters.lisp
Last active September 19, 2024 04:09
SBCL 1.5.9 jump-table compilation for `case` and nested `if` sequence
;; This also gets converted into a jump table
(defun fn (x)
(if (eql x #\a)
:a
(if (eql x #\b)
:b
(if (eql x #\c)
:c
(if (eql x #\d)
:d)))))
@brentp
brentp / compare-wrappers.py
Last active May 2, 2024 08:11
compare call overhead of cffi and cython
"""
Compare speed of a cython wrapper vs a cffi wrapper to the same underlying
C-code with a fast function and a longer-running function.
This should run anywhere that has cffi and cython installed.
Ouput on my machine with python2.7:
brentp@liefless:/tmp$ python compare-wrappers.py