Skip to content

Instantly share code, notes, and snippets.

@gfrison
gfrison / gist:1188105
Created September 2, 2011 07:37
add mapping contentType riak-java-client
Index: src/main/java/com/basho/riak/pbc/RiakObject.java
===================================================================
--- src/main/java/com/basho/riak/pbc/RiakObject.java (revision 84)
+++ src/main/java/com/basho/riak/pbc/RiakObject.java (revision 125)
@@ -244,4 +244,8 @@
return d;
}
+ public String getContentType() {
+ return contentType;
@gfrison
gfrison / gist:1186421
Created September 1, 2011 15:27
app.config
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
[
{default_bucket_props, [{n_val,1},
{allow_mult,false},
{last_write_wins,false},
{precommit, []},
{postcommit, []},
{chash_keyfun, {riak_core_util, chash_std_keyfun}},
{linkfun, {modfun, riak_kv_wm_link_walker, mapreduce_linkfun}}
@gfrison
gfrison / groovy-date-time-operations
Created February 5, 2011 15:00
How to add months, days, years to a date in Groovy
Groovy also has a Time Category class which gives you DSL style syntax for manipulating dates. Here is an example:
import org.codehaus.groovy.runtime.TimeCategory
now = new Date()
println now
use(TimeCategory) {
footballPractice = now + 1.week - 4.days + 2.hours - 3.seconds
}
println footballPractice
which will produce output like this: