Skip to content

Instantly share code, notes, and snippets.

@mallim
mallim / logstash.conf
Created July 19, 2016 03:15
Logstash config for Spring Boot's default logging
input {
file {
type => "java"
tags => [ "fornax-data-share-eureka" ]
# Logstash insists on absolute paths...
path => "D:/fornax-data-share-runtime/eureka/fornax-data-share-eureka.log"
codec => multiline {
pattern => "^%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{TIME}.*"
negate => "true"
what => "previous"
Name Description
Apache Camel Camel is an Open Source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data.
Apache Commons Lang My fav : StringUtils.
Axon Framework One of the best libraries for you to learn DDD, CQRS, Event-Sourcing
Caffeine A high performance, near optimal caching library based on Java 8 and a faster replacement of Guava Cache.
Camunda BPM My initial impression is easier to use than Activiti
Content Services for Spring Cloud-Native Content Management Extensions for Spring.
cron-utils De
\documentclass[
fromalign=left, % letter head on the right
fromphone, % show phone number
fromaddress,
fromemail, % show email
version=last, % latest version of KOMA letter
refline=dateleft, % aligns both the city and the date to the left
backaddress=off, % Sender address in this window
foldmarks=on, % Print foldmarks
parskip=full,
@mallim
mallim / SQLiteDialect.java
Created January 15, 2016 08:38 — forked from virasak/SQLiteDialect.java
SQLite dialect for Hibernate
/*
* The author disclaims copyright to this source code. In place of
* a legal notice, here is a blessing:
*
* May you do good and not evil.
* May you find forgiveness for yourself and forgive others.
* May you share freely, never taking more than you give.
*
*/
package org.hibernate.dialect;

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@mallim
mallim / Try.java
Created October 21, 2013 02:23
Jersey @put and @delete with Backbone.emulateHTTP set to true
import com.sun.jersey.api.view.Viewable;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Map;
@Path("/try")
@mallim
mallim / MyModelOverrideLocal.js
Created October 18, 2013 06:53
Example showing how to override Backbone Model sync method (specific to a model)
var MyModelOverrideLocal = Backbone.Model.extend({
sync: function (method, model, options) {
if ( method === 'delete' ) {
if ( options.data ) {
// properly formats data for back-end to parse
options.data = JSON.stringify(options.data);
}
// transform all delete requests to application/json
@mallim
mallim / TestStandaloneStories.java
Created October 9, 2013 01:47
JBehave with Spring Framework Setup - Advantage of this approach - can control the story sequence
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
import org.jbehave.core.configuration.spring.SpringStoryControls;
import org.jbehave.core.failures.FailingUponPendingStep;
import org.jbehave.core.failures.PendingStepStrategy;
import org.jbehave.core.io.CodeLocations;
import org.jbehave.core.io.LoadFromClasspath;
import org.jbehave.core.io.StoryFinder;
import org.jbehave.core.junit.JUnitStories;
@mallim
mallim / TestWebStories.java
Created October 9, 2013 01:49
JBehave, Selenium with Spring
import com.thoughtworks.selenium.Selenium;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.embedder.StoryControls;
import org.jbehave.core.failures.FailingUponPendingStep;
import org.jbehave.core.failures.PendingStepStrategy;
import org.jbehave.core.io.CodeLocations;
import org.jbehave.core.io.LoadFromClasspath;
import org.jbehave.core.io.StoryFinder;
import org.jbehave.core.junit.JUnitStories;
import org.jbehave.core.reporters.CrossReference;
@mallim
mallim / 1.js
Created September 10, 2013 01:13
requirejs - Have a module that takes no dependencies. Example from http://tech.pro/blog/1561/five-helpful-tips-when-using-requirejs
//
// Have a module that takes no dependencies.
//
define({
someProp: "Oooh, how interesting!",
someMethod: function() {
// do interesting work
return compellingValue;
}
});