Skip to content

Instantly share code, notes, and snippets.

View ezhulenev's full-sized avatar
🏠
Working from home

Eugene Zhulenev ezhulenev

🏠
Working from home
View GitHub Profile
@aphyr
aphyr / with-retry.clj
Created January 20, 2016 03:14
Recur from within catch block
(defrecord Retry [bindings])
(defmacro with-retry
"It's really fucking inconvenient not being able to recur from within (catch)
expressions. This macro wraps its body in a (loop [bindings] (try ...)).
Provides a (retry & new bindings) form which is usable within (catch) blocks:
when this form is returned by the body, the body will be retried with the new
bindings."
[initial-bindings & body]
(assert (vector? initial-bindings))
@bishboria
bishboria / springer-free-maths-books.md
Last active March 22, 2024 11:19
Springer made a bunch of books available for free, these were the direct links
@tonymorris
tonymorris / folds.scala
Last active August 29, 2015 14:25
Fold exercises in Scala
trait MyOption[A] {
def fold[B](n: => B, s: A => B): B
// Define the usual Option API.
//
// * Constructors (on the object)
// some
// none
// * methods
// map
@fponticelli
fponticelli / Main.hx
Created February 15, 2015 16:21
Minimalistic Webserver with NodeJS + Express + Haxe (with Macros) and an experimental library called restx
import restx.App;
class Main implements restx.IRoute {
@:path("/")
function index()
response.send("Hello World!");
public static function main() {
var app = new App(9998);
app.router.register(new Main());
@wm
wm / Powerline.md
Last active September 6, 2022 00:55
Installing powerline on Mac OSX. The following was done in version Version 10.8.2

Install dependencies

brew install cmake
brew install python
sudo easy_install pip

Add powerline bin to your path. In your zshrc file (or the paths files sourced in zshrc) add the following line

PATH="/usr/local/share/python/:$PATH"

Reinstall MacVim with brew

@munhitsu
munhitsu / gist:1034876
Last active November 29, 2020 09:10
python 2.7.5 install on OSX (10.8+) using brew (pip, easy_install, virtualenv, virtualenvwrapper)
# In case you had some strange python installation
# NOTE: .pydistutils.cfg seems to be not compatible with brew install python
# areas I needed to clean before installation
# clean up ~/Library/Python
# clean up .local
# preconditions:
# xcode with command line tools installed
xcode-select --install