This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(riak). | |
-author("Ivan Blinkov <[email protected]>"). | |
-export([multiget/3]). | |
multiget(Pid, Bucket, Keys) -> | |
case riakc_pb_socket:mapred(Pid, | |
[{Bucket, Key} || Key <- Keys], | |
[ | |
{reduce, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(riak). | |
-author("Ivan Blinkov <[email protected]>"). | |
-export([incr/2]). | |
-define(COUNTERS_BUCKET,<<"counters">>). | |
incr(Pid, Key) -> | |
{ok, Object} = riakc_pb_socket:put(Pid, | |
riakc_obj:new(?COUNTERS_BUCKET, Key, <<>>), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(event_server). | |
-behaviour(gen_server). | |
-author("Ivan Blinkov <[email protected]>"). | |
%% -------------------------------------------------------------------- | |
%% | |
%% Basically it just implements a publish/subscribe pattern for SockJS | |
%% using a single fanout RabbitMQ exchange as a message bus. | |
%% | |
%% Eventually got it all replaced with https://github.com/blinkov/sockjs-pubsub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(uppercase_precommit_hook). | |
-export([uppercase_key/1, uppercase_value/1]). | |
uppercase_key(Object) -> | |
riak_object:new(riak_object:bucket(Object), | |
string:to_upper(riak_object:key(Object)), | |
riak_object:get_value(Object), | |
riak_object:get_metadata(Object) | |
). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery Favicon plugin | |
* http://hellowebapps.com/products/jquery-favicon/ | |
* | |
* Copyright (c) 2010 Volodymyr Iatsyshyn ([email protected]) | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
* | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(riak_solr_client). | |
-author("Ivan Blinkov <[email protected]>"). | |
%% WARNING: Not yet tested in production, use with care. | |
%% | |
%% This module provides access to sort and limit/offset features of Riak | |
%% accessible only via Solr interface. | |
%% | |
%% Supposed to be used with conjunction with: | |
%% https://github.com/basho/riak-erlang-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(tpl_bench). | |
-export([run/0]). | |
%% Mustache.erl: https://github.com/mojombo/mustache.erl | |
%% Walrus: https://github.com/devinus/walrus | |
%% | |
%% Sample results: | |
%% | |
%% Mustache --- | |
%% Total time: 5.2954s | |
%% Mean render time: 0.5295ms |