Skip to content

Instantly share code, notes, and snippets.

@0x6e6562
0x6e6562 / LuceneRollbackTest.scala
Created June 5, 2011 13:28
Lucene disk buffering test with small heap (-Xmx32m) using Lucene 3.2.0
package foo
import org.apache.lucene.document.Document
import org.apache.lucene.document.Field
import com.eaio.uuid.UUID
import org.apache.lucene.store.FSDirectory
import java.io.File
import org.apache.lucene.index.IndexWriter
import org.apache.lucene.analysis.WhitespaceAnalyzer
@0x6e6562
0x6e6562 / main.go
Created January 31, 2014 08:21
Simple gocql batch example
package main
import (
"github.com/tux21b/gocql"
"log"
)
// create table foo (
// bar bigint,
// baz ascii,
@0x6e6562
0x6e6562 / DBWrapper.java
Created June 27, 2014 16:03
Just some glue to execute a bunch of statements in one TX using the JOOQ API
public <T> T execute(Function<DSLContext,T> fun) {
T result = null;
Connection connection = null;
DatabaseException userException = null;
try {
connection = dataSource.getConnection();
connection.setAutoCommit(false);
@0x6e6562
0x6e6562 / gist:b891bc8bd02bdfe28b8b
Created August 13, 2014 18:10
gocql Travis Build 371 v1
Using worker: worker-linux-11-2.bb.travis-ci.org:travis-linux-2
$ git clone --depth=50 git://github.com/gocql/gocql.git gocql/gocql
Cloning into 'gocql/gocql'...
remote: Counting objects: 652, done.
remote: Compressing objects: 100% (347/347), done.
remote: Total 652 (delta 388), reused 558 (delta 304)
Receiving objects: 100% (652/652), 271.73 KiB | 0 bytes/s, done.
Resolving deltas: 100% (388/388), done.
Checking connectivity... done.
Using worker: worker-linux-9-1.bb.travis-ci.org:travis-linux-10
$ git clone --depth=50 git://github.com/gocql/gocql.git gocql/gocql
Cloning into 'gocql/gocql'...
remote: Counting objects: 647, done.
remote: Compressing objects: 100% (348/348), done.
remote: Total 647 (delta 385), reused 550 (delta 298)
Receiving objects: 100% (647/647), 270.06 KiB | 0 bytes/s, done.
Resolving deltas: 100% (385/385), done.
Checking connectivity... done.
@0x6e6562
0x6e6562 / gist:3aad3895dab4242a67ae
Created October 27, 2014 19:20
Multiline Swagger annotations
/**
* Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,
* totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae
* dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
* sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est,
* qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi
* tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,
* quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
* Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur,
* vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
Using worker: worker-linux-5-1.bb.travis-ci.org:travis-linux-8
travis_fold:start:git.1
travis_time:start:08144280
$ git clone --depth=50 git://github.com/gocql/gocql.git gocql/gocql
Cloning into 'gocql/gocql'...
remote: Counting objects: 1063, done.
remote: Compressing objects: 0% (1/501) 
remote: Compressing objects: 1% (6/501) 
remote: Compressing objects: 2% (11/501) 
Using worker: worker-linux-10-2.bb.travis-ci.org:travis-linux-8
$ git clone --depth=50 git://github.com/gocql/gocql.git gocql/gocql
Cloning into 'gocql/gocql'...
remote: Counting objects: 1063, done.
remote: Compressing objects: 100% (501/501), done.
remote: Total 1063 (delta 627), reused 982 (delta 557)
Receiving objects: 100% (1063/1063), 397.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (627/627), done.
Checking connectivity... done.
@0x6e6562
0x6e6562 / gist:778d2ca2b72d4ad7645b
Created October 30, 2014 15:04
Travis ccm SIGQUIT
Using worker: worker-linux-4-1.bb.travis-ci.org:travis-linux-16
travis_fold:start:git.1
travis_time:start:2f433f65
$ git clone --depth=50 git://github.com/gocql/gocql.git gocql/gocql
Cloning into 'gocql/gocql'...
remote: Counting objects: 1063, done.
remote: Compressing objects: 0% (1/501) 
remote: Compressing objects: 1% (6/501) 
remote: Compressing objects: 2% (11/501) 
package se.qall.middleton.services;
import com.jayway.restassured.RestAssured;
import com.relops.snowflake.Snowflake;
import com.xebialabs.restito.server.StubServer;
import org.glassfish.grizzly.http.Method;
import org.glassfish.grizzly.http.server.Response;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;