Skip to content

Instantly share code, notes, and snippets.

View lazaropj's full-sized avatar
🏠
Working from home

Lazaro Jr lazaropj

🏠
Working from home
View GitHub Profile
@lazaropj
lazaropj / livraria.sql
Created April 26, 2017 18:17 — forked from deusmar/livraria.sql
Correção de datas com dia 0 (zero)
This file has been truncated, but you can view the full file.
create table livros (
id integer primary key auto_increment not null,
nome varchar(100) not null,
data_de_lancamento date not null,
autor_id integer not null,
preco decimal(10,2) not null
);
create table autores (
id integer primary key auto_increment not null,
nome varchar(100) not null
create table medicos (
id integer primary key auto_increment not null,
crm varchar(50) not null,
nome varchar(100) not null
);
create table receitas (
id integer primary key auto_increment not null,
medico_id int not null,
nome_remedio varchar(100) not null,
This file has been truncated, but you can view the full file.
create table livros (
id integer primary key auto_increment not null,
nome varchar(100) not null,
data_de_lancamento date not null,
autor_id integer not null,
preco decimal(10,2) not null
);
create table autores (
id integer primary key auto_increment not null,
nome varchar(100) not null
@lazaropj
lazaropj / EsId.java
Created August 20, 2016 16:44 — forked from strokine/EsId.java
Utility to populate data from ElasticSearch results to POJO and from POJO to ElasticSearch Source for indexing
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface EsId {
}
@lazaropj
lazaropj / gist:a08cc3809121a7298a16
Created March 8, 2016 14:29
Refactor Java pro Ivazim
public class PerguntaService {
//METODO QUE DEVE SER TESTADO, POIS A LOGIDA DE OBTER A LISTA TA AQUI
public List<Pergunta> listarPerguntas(){
return List<Pergunta> perguntas = LogicaParaObterEssaLista();
}
//METODO UNICAMENTE FEITO PARA TRATAR E FAZER O RETORNO PARA O CONTROLLER
public static void main(String[] args) {
// String consultaSimplesURL = "http://www8.receita.fazenda.gov.br/SIMPLESNACIONAL/aplicacoes.aspx?id=21";
String consultaSimplesURL = "http://www.santander.com.br";
HashMap<String,Object> inflate = new HashMap<String,Object>();
// inflate.put("cnpj","ContentPlaceHolderConteudo_lblCNPJ::text");
// inflate.put("nomeEmpresaResult","ContentPlaceHolderConteudo_lblNomeEmpresa::text");
// inflate.put("situacaoResult","ContentPlaceHolderConteudo_lblSituacaoSimples::text");
@lazaropj
lazaropj / gist:0a6ae1b05960be8d30a2
Created January 23, 2015 00:17
Auth com AngularJS e Java
Filtro JAVA
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
getToken((HttpServletRequest) request);
chain.doFilter(request, response);
}
private String getToken(HttpServletRequest httpRequest) throws ServletException {
String token = null;
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">