Skip to content

Instantly share code, notes, and snippets.

View netstart's full-sized avatar

Clayton K. N. Passos netstart

View GitHub Profile
Source to autocompile rest source, to javascript source
Use:
$> grunt watch
package br.com.elotech.tributacao.repository.smt.suite;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Modifier;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
Run jacoco without modify pom.xml to sonnar get coverage and generate html using cobertura
mvn -U clean org.jacoco:jacoco-maven-plugin:prepare-agent deploy org.codehaus.mojo:cobertura-maven-plugin:cobertura -Dcobertura.report.format=html
import java.lang.reflect.*;
import java.util.*;
import java.util.Collections;
import org.hibernate.*;
import org.hibernate.engine.*;
import org.hibernate.hql.*;
import org.hibernate.hql.ast.*;
import org.hibernate.impl.*;
import org.hibernate.loader.*;
import java.util.Calendar;
import java.util.Date;
/**
* DateUtils ignore hour
*/
public class DateUtils {
/** The maximum date possible. */
@netstart
netstart / EntityBase.java
Created July 15, 2015 16:52
default implementation to hashCode, equals and toString
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
public abstract class EntityBase implements EntityDef {
private static final long serialVersionUID = -4629136366635323935L;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.html.simpleparser.HTMLWorker;
import com.lowagie.text.pdf.PdfWriter;
import org.apache.pdfbox.exceptions.COSVisitorException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDResources;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
@netstart
netstart / FuturesB.java
Created March 4, 2016 02:18 — forked from benjchristensen/FuturesB.java
FuturesB.java Example of using Futures for nested calls showing how it blocks inefficiently.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@netstart
netstart / BigDecimalUtil.java
Last active December 23, 2019 18:16
BigDecimalUtil.java
public class BigDecimalUtil {
public static int compareToIgnoreSignal(BigDecimal a, BigDecimal b) {
if (a.signum() < 0) a = a.multiply(new BigDecimal(-1));
if (b.signum() < 0) b = b.multiply(new BigDecimal(-1));
return a.compareTo(b);
}
public static Boolean isMinorThanIgnoreSignal(BigDecimal a, BigDecimal b) {
return compareToIgnoreSignal(a, b) < 0;
LOG: <module-item ng-reflect-icone-imagem="img/modules/administracao-controleprocessos.png" ng-reflect-titulo="Controle de processos" ng-reflect-url="http://medium.com/codigorefinado"><div class="ma-item" moduleitemmouseenter="">
<a id="module-access-url" target="_blank" ng-reflect-href="http://medium.com/codigorefinado" href="http://medium.com/codigorefinado" ng-reflect-title="Controle de processos" title="Controle de processos">
<div class="ma-item-icon">
<img id="module-access-img" ng-reflect-src="img/modules/administracao-controleprocessos.png" src="img/modules/administracao-controleprocessos.png">
</div>
<h2 class="ma-item-title" id="module-access-title">
Controle de processos
</h2>