Skip to content

Instantly share code, notes, and snippets.

@mokies
mokies / LoggingSpy.java
Last active August 29, 2015 14:18
Logging Spy
package es.moki;
import com.google.common.collect.Lists;
import org.apache.log4j.Appender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggingEvent;
import org.mockito.ArgumentCaptor;
import java.util.List;
@mokies
mokies / gist:f855efc19acca264c244
Last active August 29, 2015 14:01
keybase.md
### Keybase proof
I hereby claim:
* I am mokies on github.
* I am mokies (https://keybase.io/mokies) on keybase.
* I have a public key whose fingerprint is E47E 8CBA 37BC 2947 6771 C23F 39BB 375E 333D C78B
To claim this, I am signing this object:
@mokies
mokies / gist:7554129
Created November 19, 2013 22:59
Logging spy for testin log4j backed logging
package au.com.coles.boston.app.service.impl;
import com.google.common.collect.Lists;
import org.apache.log4j.Appender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggingEvent;
import org.mockito.ArgumentCaptor;
import java.util.List;
@mokies
mokies / identifer.rb
Last active December 24, 2015 19:09
Ruby script for Louise to replace <P00000> place holder text with incrementing identifier eg. <P00001>
#!/usr/bin/env ruby
class Identify
def insertIdentifiers (fileName)
out_filename = fileName.gsub(".rtf", "-transformed.rtf")
puts out_filename
out_file = File.new(out_filename, "w")
count = 0
@mokies
mokies / BaseEntity.java
Last active December 17, 2015 00:10
hibernate repository
package es.moki.app.repository.domain;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
@MappedSuperclass
public abstract class BaseEntity<ID extends Serializable> implements IdentifiableEntity<ID> {
@Id