Skip to content

Instantly share code, notes, and snippets.

View panchenko's full-sized avatar

Alex Panchenko panchenko

View GitHub Profile
@Bean
public static TomcatEmbeddedServletContainerFactory tomcatEmbeddedServletContainerFactory() {
return new TomcatEmbeddedServletContainerFactory() {
@Override
protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer(Tomcat tomcat) {
final ErrorReportValve errorReportValve = new ErrorReportValve();
errorReportValve.setShowServerInfo(false);
errorReportValve.setShowReport(false);
tomcat.getHost().getPipeline().addValve(errorReportValve);
return super.getTomcatEmbeddedServletContainer(tomcat);
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
var text = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus.
@panchenko
panchenko / Address.java
Created November 27, 2014 18:52
rabbitmq-java-client-parseAddresses
diff -r a2a05fde0e99 src/com/rabbitmq/client/Address.java
--- a/src/com/rabbitmq/client/Address.java Wed Nov 26 13:09:31 2014 +0000
+++ b/src/com/rabbitmq/client/Address.java Fri Nov 28 00:51:02 2014 +0600
@@ -81,6 +81,9 @@
* @return a list of {@link Address} values
*/
public static Address[] parseAddresses(String addresses) {
+ if (addresses == null || addresses.length() == 0) {
+ return new Address[0];
+ }
public class SequencePattern<T> {
public static final int ONE = 0;
public static final int ONE_OR_MORE = 1;
private static class PredicateRepetitiion {
final int repetitiion;
final Predicate<Object> predicate;