Skip to content

Instantly share code, notes, and snippets.

gfrison / rxnetty multi part problem
Created August 26, 2015 08:39
rxnetty multi part problem
import java.nio.charset.Charset;
import java.util.Random;
import io.netty.handler.logging.LogLevel;
import io.reactivex.netty.protocol.http.client.HttpClient;
public class ConcatUpload
gfrison / doublets.groovy
Created February 17, 2014 12:04
Dodgsons doublets in Groovy. The rules of the Puzzle are simple enough. Two words are proposed, of the same length; and the Puzzle consists in linking these together by interposing other words, each of which shall differ from the next word in one letter only. That is to say, one letter may be changed in one of the given words, then one letter in…
import com.thoughtworks.xstream.core.util.PrioritizedList
import groovy.transform.Field
import java.text.DecimalFormat
* Dodgsons Duoblets
* User: gfrison

Keybase proof

I hereby claim:

  • I am gfrison on github.
  • I am gfrison ( on keybase.
  • I have a public key whose fingerprint is 83D5 27E0 3F34 C133 F4B3 11D4 1145 0972 D3CC EDA9

To claim this, I am signing this object:

gfrison / gist:a8d31c761040203b4014
Last active August 29, 2015 14:16
embedded (without spring boot) spring cloud netflix-hystrix example
@ContextConfiguration(loader = AnnotationConfigContextLoader.class, classes = {HistrixIT.Config.class})
public class HistrixIT
private RemoteService service;
private static Function<String, String> function = mock(Function.class);
import java.nio.charset.Charset;
import java.util.Random;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.reactivex.netty.RxNetty;
import io.reactivex.netty.protocol.http.client.HttpClientRequest;
import rx.Observable;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.proxy.HttpProxyHandler;
import io.reactivex.netty.protocol.http.client.HttpClient;
import io.reactivex.netty.protocol.http.client.HttpClientResponse;
import org.junit.Ignore;
import org.junit.Test;
import rx.Observable;
gfrison / gist:1186421
Created September 1, 2011 15:27
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
{default_bucket_props, [{n_val,1},
{precommit, []},
{postcommit, []},
{chash_keyfun, {riak_core_util, chash_std_keyfun}},
{linkfun, {modfun, riak_kv_wm_link_walker, mapreduce_linkfun}}
gfrison / gist:1188105
Created September 2, 2011 07:37
add mapping contentType riak-java-client
Index: src/main/java/com/basho/riak/pbc/
--- src/main/java/com/basho/riak/pbc/ (revision 84)
+++ src/main/java/com/basho/riak/pbc/ (revision 125)
@@ -244,4 +244,8 @@
return d;
+ public String getContentType() {
+ return contentType;
gfrison / gist:1347781
Created November 8, 2011 13:53
groovy camel builder script
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.language.groovy.GroovyRouteBuilder;
import org.apache.camel.*
@Grab(group='org.slf4j', module='slf4j-api', version='1.6.1')
@Grab(group='org.slf4j', module='slf4j-log4j12', version='1.6.1')
@Grab(group='org.apache.camel', module='camel-groovy', version='2.8.0')
@Grab(group='org.apache.camel', module='camel-core', version='2.8.0')
@Grab(group='org.apache.camel', module='camel-jetty', version='2.8.0')
class SampleRoute extends GroovyRouteBuilder {
gfrison / gist:1348082
Last active September 27, 2015 23:18
script bash for performance testing on RESTful services. It measures quickly how long does it take accomplish http requests
START=$(date +%s.%N)
for i in {1..100};
curl http://localhosT:3000/rest -d '<request>'>/dev/null 2>&1
END=$(date +%s.%N)
DIFF=$(echo "$END - $START" | bc)