Skip to content

Instantly share code, notes, and snippets.

View shizzard's full-sized avatar

Denis Fakhrtdinov shizzard

View GitHub Profile
@shizzard
shizzard / books
Last active August 29, 2015 14:00
Books
http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520/
http://www.amazon.com/Compilers-Principles-Techniques-Alfred-Aho/dp/0201100886/
http://www.amazon.com/G%C3%B6del-Escher-Bach-Eternal-Golden/dp/0465026567/
http://www.amazon.com/Programming-Pearls-2nd-Jon-Bentley/dp/0201657880/
http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052/
http://www.amazon.com/Programming-Environment-Addison-Wesley-Professional-Computing/dp/0321637739/
http://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530/
http://www.amazon.com/Practices-Agile-Developer-Pragmatic-Bookshelf/dp/097451408X/
http://www.amazon.com/Design-Everyday-Things-Revised-Expanded/dp/0465050654/
http://www.amazon.com/Pragmatic-Thinking-Learning-Refactor-Programmers/dp/1934356050/
(evadev@shizz-worktop)3> himem(300000).
[{<0.7.0>,426512},{<0.6.0>,688816}]
(evadev@shizz-worktop)4> pi(himem(300000)).
** process <0.7.0> (registered as application_controller) is now waiting **
initial call: gen_server:loop/6
current function: erlang:apply/2
dictionary: [{'$ancestors',[<0.2.0>]},
{'$initial_call',{application_controller,start,1}}]
total memory: undefined
linked to: [<0.90.0>,<0.109.0>,<0.115.0>,<0.250.0>,<0.102.0>,
request: object(
host: string,
method: enum("GET", "POST", "PUT", "DELETE"),
params: list(
object(
name: string,
value: string
)
)
)
curl "localhost:12330/counter?action=offer_complete&sid=123123123&hash=epttest&hashVar=epttest"
<<"{\"method\":\"completeOffer\",\"sid\":\"123123123\",\"hash\":\"epttest\",\"hashVar\":\"epttest\"}">>
-module(handler_param_action).
-behaviour(gen_handler).
-include("ept.hrl").
-include("ept_hit.hrl").
-include_lib("cowboy/include/http.hrl").
-export([prepare/2, handle/1]).
init([Host, Port]) ->
try eredis:start_link(Host, Port) of
{ok, C} ->
{ok, #state{redis_conn = C}};
{error, Error} ->
?WARNING("Redis connection (~p:~p) failed: ~p", [Host, Port, Error]),
{ok, #state{}};
Else ->
?WARNING("Redis connection (~p:~p) failed: ~p", [Host, Port, Else]),
{ok, #state{}}
[
{redis_pool2,{poolboy,start_link,[[{name,{local,redis_pool2}},{worker_module,ept_redis_worker},{size,10},{max_overflow,100}],["localhost",6402]]},permanent,5000,worker,[poolboy]},
{redis_pool1,{poolboy,start_link,[[{name,{local,redis_pool1}},{worker_module,ept_redis_worker},{size,10},{max_overflow,100}],["localhost",6401]]},permanent,5000,worker,[poolboy]},
{redis_pool0,{poolboy,start_link,[[{name,{local,redis_pool0}},{worker_module,ept_redis_worker},{size,10},{max_overflow,100}],["localhost",6400]]},permanent,5000,worker,[poolboy]}
]
@shizzard
shizzard / my.erl
Created November 14, 2012 14:03 — forked from si14/my.erl
send_error(ReplyTo, UUID, RoutingKey, {invalid, protobuff}) ->
eva_tpf:generic_error(ReplyTo, UUID, RoutingKey, [
{source, 'CLIENT'},
{type, <<"INVALID_PROTOBUFF_BINARY">>},
{description, <<"Protobuff binary provided is invalid">>},
{permanent, true}
]);
send_error(ReplyTo, UUID, RoutingKey, {invalid, props}) ->
eva_tpf:generic_error(ReplyTo, UUID, RoutingKey, [
{source, 'CLIENT'},
-module(gen_tpf_eva_handler).
-export([get_module_name/3]).
-callback major_version() ->
integer().
-callback minor_version() ->
integer().
-callback handle(binary()) ->
ok | {error, any()}.
Specs = [
{name, fun
(Data) when is_list(Data) -> ok;
(Data) -> {error, not_list}
end},
{age, fun
(Data) when is_integer(Data) -> ok;
(Data) -> {error, not_integer}
end}
],