Skip to content

Instantly share code, notes, and snippets.

View djnym's full-sized avatar

Anthony Molinaro djnym

View GitHub Profile

Keybase proof

I hereby claim:

  • I am djnym on github.
  • I am djnym (https://keybase.io/djnym) on keybase.
  • I have a public key ASASqdMiMJDMy5jbFtIFbN4OqVk3_QFXXp8mQZni9BnqPAo

To claim this, I am signing this object:

-module (mondemand_server_fs_resource).
-export ([ init/1 ]).
-export ([ allowed_methods/2,
resource_exists/2,
content_types_provided/2,
provide_content/2
]).
-record (state, {root, filepath, is_dir}).
@djnym
djnym / gist:1068552
Created July 6, 2011 23:05
bitcask merge error
=ERROR REPORT==== 6-Jul-2011::23:04:27 ===
Failed to merge ["/var/lib/riak/bitcask/922002009488050083163652736264373858103254319104",
[],
["/var/lib/riak/bitcask/922002009488050083163652736264373858103254319104/1302041143.bitcask.data",
"/var/lib/riak/bitcask/922002009488050083163652736264373858103254319104/1309992379.bitcask.data"]]: {{case_clause,
<<13,160,
201,224,
77,155,
162,231,
@djnym
djnym / tmp.erl
Created March 14, 2011 22:31
Use of proper to test a simple regex
-module (tmp).
-include_lib ("proper/include/proper.hrl").
prop_all () ->
?FORALL (Int, non_neg_integer(),
begin
{match, [O]} =
re:run (integer_to_list(Int), <<"[0-9]+">>,
[{capture,first,list}]),
@djnym
djnym / connection_sup.erl
Created January 21, 2011 22:30
Yet Another Riak Client Pool
% connection supervisor
-module (connection_sup).
-behaviour (supervisor).
-export ([start_link/1, start_connection/0, init/1]).
start_link({Ip, Port, Options}) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, [Ip, Port, Options]).
start_connection () ->
supervisor:start_child (?MODULE, []).