Skip to content

Instantly share code, notes, and snippets.

View hairyhum's full-sized avatar

Daniil Fedotov hairyhum

  • Ockam
  • 08:14 (UTC -04:00)
View GitHub Profile
@kellymclaughlin
kellymclaughlin / gist:4043845
Created November 9, 2012 05:16
riakc PUT with 2I
Indexes = [{<<"index1_bin">>, <<"val">>},
{<<"index2_int">>, 1}],
Meta = dict:store(<<"index">>, Indexes, dict:new()),
Obj = riakc_obj:new(<<"mybucket">>, <<"mykey">>, <<"myval">>),
Obj1 = riakc_obj:update_metadata(Obj, Meta),
riakc_pb_socket:put(RiakPid, Obj1).
@lpgauth
lpgauth / gist:3789152
Created September 26, 2012 16:53
basic auth with Cowboy
-module(auth_handler).
-compile({parse_transform, seqbind}).
-export([init/3, handle/2, terminate/2]).
-define(USERNAME, <<"admin">>).
-define(PASSWORD, <<"password">>).
%% public
init(_Transport, Req, []) ->