Skip to content

Instantly share code, notes, and snippets.

View rhumbertgz's full-sized avatar

Humberto Rodríguez A. rhumbertgz

View GitHub Profile
@rhumbertgz
rhumbertgz / info_server.txt
Last active October 30, 2016 05:49
Elixir Registry Benchmarks - HP Proliant HPDL585G7, 30-10-2016 v1.1
hrguez@serenity:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
hrguez@serenity:~$ uname -a
Linux serenity 4.2.0-42-generic #49-Ubuntu SMP Tue Jun 28 21:26:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
hrguez@serenity:~$ cat /proc/cpuinfo | grep "model name" | head -n 1
model name : AMD Opteron(tm) Processor 6376
@rhumbertgz
rhumbertgz / macrotest.ex
Last active August 29, 2016 22:58
What could be the reason to fail when I call the macro inside another module using USE?
defmodule MacroTest do
def __using__(_opts) do
quote do
import unquote(__MODULE__)
end
end
defmacro mymacro(do: block) do
quote do
@rhumbertgz
rhumbertgz / _reader-macros.md
Last active August 24, 2016 21:44 — forked from chaitanyagupta/_reader-macros.md
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

@rhumbertgz
rhumbertgz / gist:ee0bf432edfa89ffa0a47405f3250fcd
Created May 15, 2016 22:27
Compilation issues with OTP 18.3: "Failed to load erlang_js_drv.so"
Hello, I have been trying to compile erlang_js with OTP 18.3, but allways I get this message "Failed to load erlang_js_drv.so".
I tried in Ubunto 14.0.04 and OSX 10.11.4
Erlang log:
======================================================================================
==> erlang_js (eunit)
@rhumbertgz
rhumbertgz / (riak_api) demo_api_pb_service.erl
Last active August 29, 2015 14:26
Hello, I have been working in a extension to riak_pb, but every time that I try to use my new message in my extension of riak_erlang_client I obtain this message "Socket error while sending riakc request: einval. Bad value on output port 'tcp_inet'". These files represent a dummy example that replicate my error. Any suggestion?
-module(demo_api_pb_service).
-behaviour(riak_api_pb_service).
-export([init/0,
decode/2,
encode/1,
process/2,
process_stream/3]).
@rhumbertgz
rhumbertgz / gist:b7b0b5c26134c1d10b2c
Last active August 29, 2015 14:26
Error on Riak ( 2.1.1 ) startup
Hello, I have an error trying to start riak after compiled it from the source code (riak 2.1.1).
----------------------------------------
soft67:bin Humberto$ ./riak start
!!!!
!!!! WARNING: ulimit -n is 2560; 65536 is the recommended minimum.
!!!!
riak failed to start within 15 seconds,
see the output of 'riak console' for more information.
If you want to wait longer, set the environment variable
WAIT_FOR_ERLANG to the number of seconds to wait.
@rhumbertgz
rhumbertgz / Error description
Created April 8, 2015 09:29
Riak 2.0 Pre/Post commit error
Hello everyone,
I have been trying to follow the examples of hooks http://docs.basho.com/riak/2.0.0/dev/using/commit-hooks/, but allways obtained an error (see below).
I am using Riak 2.0.0
These are the commands that I am using.
curl -XPUT -H "Content-Type: application/json" -d '{"props":{"precommit":[{"mod": "validate_demo", "fun": "validate"}]}}' http://127.0.0.1:8090/buckets/demo/props