Skip to content

Instantly share code, notes, and snippets.

Avatar

Craig Baker mokies

View GitHub Profile
View LoggingSpy.java
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;
View gist:f855efc19acca264c244
### 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 Nov 19, 2013
Logging spy for testin log4j backed logging
View gist:7554129
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 Dec 24, 2015
Ruby script for Louise to replace <P00000> place holder text with incrementing identifier eg. <P00001>
View identifer.rb
#!/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 Dec 17, 2015
hibernate repository
View BaseEntity.java
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
You can’t perform that action at this time.