View avro serdes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static <T extends SpecificRecord> T getSpecificRecord( | |
String json, Schema writersSchema, Class<T> recordClass) | |
throws IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { | |
Schema readersSchema = (Schema) recordClass.getMethod("getClassSchema").invoke(null); | |
Decoder jsonDecoder = DecoderFactory.get().jsonDecoder(writersSchema, json); | |
ResolvingDecoder resolvingDecoder = DecoderFactory.get().resolvingDecoder(writersSchema, readersSchema, jsonDecoder); | |
DatumReader<T> reader = new SpecificDatumReader<>(recordClass); | |
return reader.read(null, resolvingDecoder); | |
} |
View gist:1bf7751f3f7ba25442e6d7414a9dc3ad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
for dir in ../* | |
do | |
echo | |
echo "==============" | |
echo "$dir" | |
echo "==============" | |
git --git-dir=$dir/.git --work-tree=$PWD/$dir checkout master | |
git --git-dir=$dir/.git --work-tree=$PWD/$dir pull | |
git --git-dir=$dir/.git --work-tree=$PWD/$dir status -s |
View DropwizardToMicrometerBridge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.boohoo.esbdefused.metrics; | |
import java.util.Arrays; | |
import java.util.concurrent.TimeUnit; | |
import com.codahale.metrics.Counter; | |
import com.codahale.metrics.Gauge; | |
import com.codahale.metrics.Histogram; | |
import com.codahale.metrics.Meter; | |
import com.codahale.metrics.MetricRegistry; |
View Java DateTimeFormatter to parse varying number of decimal places
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final DateTimeFormatter TIME_FORMATTER = new DateTimeFormatterBuilder().appendPattern("yyyy-MM-dd HH:mm:ss") | |
.appendFraction(ChronoField.MICRO_OF_SECOND, 0, 6, true).appendPattern("X").toFormatter(); |
View springboot-camel-jms-jdbc-tx.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.jms.ConnectionFactory; | |
import javax.sql.DataSource; | |
import org.apache.activemq.ActiveMQConnectionFactory; | |
import org.apache.activemq.RedeliveryPolicy; | |
import org.apache.activemq.camel.component.ActiveMQComponent; | |
import org.apache.activemq.pool.PooledConnectionFactory; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.spring.spi.SpringTransactionPolicy; | |
import org.springframework.boot.SpringApplication; |
View cucumber-jvm-signed-integer-pattern.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@When("^an Adjustment of \\+?(-?\\d+) is received$") | |
public void an_Adjustment_of_x_is_received(int qty) throws Throwable { | |
//send "qty" as input | |
} |
View springboot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests, sys, getopt | |
try: | |
opts, args = getopt.getopt(sys.argv[1:], "p:", ["port="]) | |
except getopt.GetoptError: | |
print('springboot.py -p <port>') | |
sys.exit(2) |
View Spring-boot-start-script.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd "`dirname "$0"`" | |
jmxOpts="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=config/jmxremote.password" | |
nohup java $jmxOpts -Djava.security.egd=file:/dev/./urandom -jar my-app-1.0.0.jar 1>/dev/null 2>stderr.log & |
View gist:60f8576e192a9ff11d24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static com.codahale.metrics.MetricRegistry.name; | |
import java.lang.management.ManagementFactory; | |
import java.util.Collections; | |
import java.util.Date; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map; | |
import javax.management.AttributeNotFoundException; |
View gist:5270359
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When I run: | |
$ jasmine-node --verbose . | |
I get absolutely no output. | |
Same with: | |
$ jasmine-node --verbose frisby.spec.js | |