Skip to content

Instantly share code, notes, and snippets.

@beckje01
beckje01 / feed.xml
Last active August 20, 2018 12:27
Cassandra atom feed
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.4.3">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2018-08-20T07:13:23-05:00</updated><id>http://localhost:4000/</id><title type="html">Apache Cassandra Website</title><subtitle>The Apache Cassandra database is the right choice when you need scalability and high availability without compromising performance. Linear scalability and proven fault-tolerance on commodity hardware or cloud infrastructure make it the perfect platform for mission-critical data. Cassandra's support for replicating across multiple datacenters is best-in-class, providing lower latency for your users and the peace of mind of knowing that you can survive regional outages.
</subtitle><entry><title type="html">Hardware-bound Zero Copy Streaming in Apache Cassandra 4.0</title><l
@beckje01
beckje01 / BearerAuthHandler.groovy
Created May 13, 2015 15:03
OAuth2 Vertx 3 Bearer Token start
import io.vertx.core.http.HttpHeaders
import io.vertx.core.http.HttpServerRequest
import io.vertx.core.json.JsonObject
import io.vertx.ext.apex.RoutingContext
import io.vertx.ext.apex.handler.impl.AuthHandlerImpl
import io.vertx.ext.auth.AuthProvider;
class BearerAuthHandler extends AuthHandlerImpl {
### Keybase proof
I hereby claim:
* I am beckje01 on github.
* I am beckje01 (https://keybase.io/beckje01) on keybase.
* I have a public key whose fingerprint is 857D 6372 9EA4 7492 4FB7 D95A C3C2 391B B016 F80A
To claim this, I am signing this object:
import org.apache.log4j.MDC
class LoggingFilters {
public static final String CORRELATION_HEADER = "X-CorrelationId" //Our Standard
def filters = {
correlationId(controller: '*', action: '*') { //For all requests
before = {
String correlationId = request.getHeader(CORRELATION_HEADER)
@beckje01
beckje01 / contextExample.groovy
Created July 28, 2014 08:49
Ratpack Context Examples
@Grab('io.ratpack:ratpack-groovy:0.9.6')
import ratpack.registry.RegistrySpec
import static ratpack.groovy.Groovy.*
import static ratpack.registry.Registries.registry
ratpack {
handlers {
handler {
@beckje01
beckje01 / gist:30c886df1189f3d2dea7
Created July 14, 2014 14:19
HttpClient Proxy Scratch
get { HttpClient httpClient ->
def result = httpClient.request("http://beckje01.com", { RequestSpec requestSpec ->
requestSpec.body.type("text/plain").stream { it << request.body.text }
requestSpec.method(request.method.toString())
request.headers.getNames().each {
requestSpec.headers.set(it, request.headers.get(it))
}
})
result.onError({
@beckje01
beckje01 / .git_ps1
Created February 2, 2014 19:50
Bash Prompt adapted
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
git_status="$(git status 2> /dev/null)"
{states:[
{
state: valid,
startDate: 2013-12-25T21:15Z,
endDate: null
},
{
state: pending,
startDate: 2013-12-25T21:15Z,
endDate: 2013-12-25T21:15Z
@beckje01
beckje01 / sonar-pom.xml
Created July 23, 2013 14:30
Example Pom reusing all unit test details and code coverage.
<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'>
<modelVersion>4.0.0</modelVersion>
<groupId>com.greatconf</groupId>
<artifactId>example-api</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>example-api</name>
<build>
<sourceDirectory>
@beckje01
beckje01 / ExposedGSON-withVersion.groovy
Last active December 14, 2015 20:39
Example ExposedGSON
package com.reachlocal.product.gson
import com.google.gson.GsonBuilder
import grails.plugin.gson.converters.GSON
import org.codehaus.groovy.grails.commons.ApplicationHolder
class ExposedGSON extends GSON {
@Lazy
private GsonBuilder gsonBuilder = {