Skip to content

Instantly share code, notes, and snippets.

View stephen-masters's full-sized avatar

Stephen Masters stephen-masters

View GitHub Profile
from("C:/router/export/csv/")
.unmarshal().csv()
.split().method("org.gratiartis.router.Splitter", "split")
.to("jms:DOCUMENT.METADATA.QUEUE");
from("jms:DOCUMENT.METADATA.QUEUE")
.processRef("org.gratiartis.router.Processor")
.to("C:/router/out/xml/");
@stephen-masters
stephen-masters / deploy-guvnor-was.sh
Last active December 15, 2015 04:59
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 http://download.jboss.org/drools/release/5.3.0.Final/guvnor-distribution-5.3.0.Final.zip
unzip guvnor-distribution-5.3.0.Final.zip
# 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/
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
entityManagerFactoryRef = "barEntityManagerFactory",
transactionManagerRef = "barTransactionManager",
basePackages = { "com.sctrcd.multidsdemo.integration.repositories.bar" })
public class BarConfig {
@Autowired
JpaVendorAdapter jpaVendorAdapter;
@stephen-masters
stephen-masters / ServletUriComponentsBuilder fixes
Last active August 29, 2015 14:02
Spring Framework servlet request parsing bug
/**
* 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);
@stephen-masters
stephen-masters / seo-spam-template
Created October 16, 2014 09:32
SEO spam comment template received
{
{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
@stephen-masters
stephen-masters / spring-platform-bom.xml
Last active August 29, 2015 14:14
Spring IO Platform BOM
<!-- Transitively bring in the Spring IO Platform Bill-of-Materials `pom.xml` -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>1.1.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@stephen-masters
stephen-masters / kmodule.xml
Created February 6, 2015 12:55
Example kmodule.xml
<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<kbase name="BusPassKbase" packages="com.sctrcd.buspassws.rules">
<ksession name="BusPassSession" />
</kbase>
</kmodule>
@stephen-masters
stephen-masters / gist:e246df0650984490e7be
Created February 6, 2015 13:01
Get a KieContainer and create a KieSession
KieContainer kieContainer = KieServices.Factory.get().getKieClasspathContainer();
KieSession kieSession = kieContainer.newKieSession("BusPassSession");
@SpringBootApplication
public class BusPassApp {
public static void main(String[] args) {
ApplicationContext ctx = SpringApplication.run(BusPassApp.class, args);
}
@Bean
public KieContainer kieContainer() {
return KieServices.Factory.get().getKieClasspathContainer();
@Service
public class BusPassService {
private final KieContainer kieContainer;
@Autowired
public BusPassService(KieContainer kieContainer) {
log.info("Initialising a new bus pass session.");
this.kieContainer = kieContainer;
}