Skip to content

Instantly share code, notes, and snippets.

Avatar

Milton Ferreira Lima Miltex

View GitHub Profile
View gist:e4fb1d78bfe6d4951e32a0416817862a
package br.miltex.service;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
View keytool
keytool -import -trustcacerts -keystore "C:\Program Files (x86)\Java\jre7\lib\security\cacerts" -noprompt -alias cert_cielo -file "D:\Users\milton.filho\scriptsSQL\itegrapc\cert\cert_cielo.cer"
View Async.java
package miltex.br.consultor;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.AsyncTask;
@Miltex
Miltex / getElementId_jQuery.js
Last active Dec 2, 2016
Pegar o valor de um elemento no frm jsf
View getElementId_jQuery.js
<script>
$(document).ready(function(){
$("#frm").submit(function(event){
//exibe com mascara
alert($('#frm\\:telefone').val());
//exibe sem mascara
var valor = $('#frm\\:telefone');
alert(valor.val().replace(/[^\d]+/g,''));
});
});
@Miltex
Miltex / pom_jsf_primefaces.xml
Last active Dec 1, 2016
POM basico jsf primefaces
View pom_jsf_primefaces.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.miltex</groupId>
<artifactId>AlgaworksJEECDIPrimefacesJPA</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
View cron
@SuppressWarnings("serial")
@Stateless
public class Cron implements Serializable {
@Schedule(hour = "1,2,3,4,5,6", minute = "*", persistent = false)
@TransactionAttribute(TransactionAttributeType.NEVER)
public void sincronizaPessoa() throws Exception {
}