Skip to content

Instantly share code, notes, and snippets.


Stephen Masters gratiartis

View GitHub Profile
gratiartis / seo-spam-template
Created Oct 16, 2014
SEO spam comment template received
View seo-spam-template
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found
any interesting article like yours. {It's|It is} pretty worth enough for
me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website
owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be
{much more|a lot more} useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally
well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as
I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or
gratiartis / ServletUriComponentsBuilder fixes
Last active Aug 29, 2015
Spring Framework servlet request parsing bug
View ServletUriComponentsBuilder fixes
* Prepare a builder by copying the scheme, host, port, path, and
* query string of an HttpServletRequest.
public static CorrectedServletUriComponentsBuilder fromRequest(HttpServletRequest request) {
String scheme = scheme(request);
String host = host(request);
int port = port(request);
entityManagerFactoryRef = "barEntityManagerFactory",
transactionManagerRef = "barTransactionManager",
basePackages = { "" })
public class BarConfig {
JpaVendorAdapter jpaVendorAdapter;
gratiartis /
Last active Dec 15, 2015
Setting up Drools Guvnor on WebSphere Application Server Liberty Profile 8.5
# Run from a location where you want to download the application.
mkdir ~/downloads ; cd ~/downloads
curl -O -L
# Explode the Guvnor .war and copy to the WAS "apps" directory
unzip guvnor-distribution-5.3.0.Final/binaries/guvnor-5.3.0.Final-tomcat-6.0.war -d guvnor
cp guvnor /usr/share/was/wlp/usr/servers/guvnor/apps/
.split().method("org.gratiartis.router.Splitter", "split")
View camel-content-based-router.xml
<camelContext xmlns="">
<from uri="webspheremq:ANY.OPERATION.REQUEST" />
<to uri="activemq:OLD.REQUEST" />
gratiartis /
Created Jan 16, 2013
This is a read-only Seam identity store implementation, which I knocked up to enable Drools Guvnor to authenticate users against Microsoft Active Directory. To use it, produce a .jar containing this class and put it in your Guvnor web application lib directory. I would recommend creating a .jar which only contains this class, as it is best to mi…
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
gratiartis /
Created Nov 16, 2012
Drools BigDecimal accumulator
import java.math.BigDecimal;
import org.drools.runtime.rule.TypedAccumulateFunction;
View maven-shade-plugin-example.xml
View maven-jar-plugin-example.xml
Use the Jar plugin to produce a reduced JAR containing only those model classes
to be used as facts in Drools/Guvnor.