Skip to content

Instantly share code, notes, and snippets.

View bytor99999's full-sized avatar

Mark Spritzler bytor99999

View GitHub Profile
// Closure that will be curried inside curryExample()
Closure nextFunction = {name, age, document ->
//do work here after I got back the document from Mongo
println("Hello $name I am $age here is the Document I got from Mongo $document")
}
void curryExample() {
def name = "John"
def age = 12
Closure callBackFromMongo = nextFunction.curry(name, age)
callMongo(documentId, callBackFromMongo)
@bytor99999
bytor99999 / gist:6717146
Created September 26, 2013 17:03
Different logging how you run Vertx
IJ opening up maven on the right, then right clicking on runmodIDEA under the maven project
[DEBUG] -- end configuration --
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[INFO] CTRL-C to stop server
KsDef(name:hdpoker_dev, strategy_class:SimpleStrategy, strategy_options:{replication_factor=1}, cf_defs:[])
KsDef(name:hdpoker_dev, strategy_class:SimpleStrategy, strategy_options:{replication_factor=1}, cf_defs:[])
@bytor99999
bytor99999 / sample.xml
Created October 8, 2012 22:19
Make Groovy in Maven
<dependencies>
<!-- Groovy dependency -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
@bytor99999
bytor99999 / PageRequestHandler.java
Created September 13, 2012 22:58
ThreadLocal object to store page and size info from the client UI to pass down to data access objects. or Anywhere.
package com.perfectworldprogramming.eventgate.utils;
import org.springframework.data.domain.PageRequest;
/**
* User: Mark Spritzler
* Date: 2/5/12
* Time: 10:32 AM
*/
public class PageRequestHandler {