This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HttpService { | |
get(url) { | |
return new Promise((resolve, reject) => { | |
let xhr = new XMLHttpRequest(); | |
xhr.open('GET', url); | |
xhr.onreadystatechange = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import br.com.willianantunes.serenata.JarbasAPI; | |
import br.com.willianantunes.support.ScenarioBuilder; | |
import org.apache.camel.Exchange; | |
import org.apache.camel.ExchangePattern; | |
import org.apache.camel.Producer; | |
import org.apache.camel.ProducerTemplate; | |
import org.apache.camel.builder.ExchangeBuilder; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.component.cxf.common.message.CxfConstants; | |
import org.apache.camel.component.cxf.jaxrs.CxfRsBinding; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.Collection; | |
import org.hibernate.Hibernate; | |
import org.hibernate.proxy.HibernateProxy; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.TypeAdapter; | |
import com.google.gson.TypeAdapterFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.willianantunes.playground; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import org.apache.camel.ProducerTemplate; | |
import org.apache.camel.PropertyInject; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.component.twitter.search.TwitterSearchComponent; | |
import org.apache.camel.model.ModelCamelContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1 - Criar/copiar tabela problemática: | |
CREATE TABLE TABELA_NOVA SELECT * FROM TABELA_PRODUCAO; | |
-- 2 - Obter último valor da PK, nosso caso 65535 | |
SELECT PK_ABUDEGA FROM TABELA_PRODUCAO ORDER BY PK_ABUDEGA DESC; | |
-- 3 - Adicionar constraints necessárias e obviamente da PK também | |
ALTER TABLE TABELA_NOVA ADD PRIMARY KEY (PK_ABUDEGA); | |
ALTER TABLE TABELA_NOVA CHANGE PK_ABUDEGA PK_AJUSTADA INT(11) UNSIGNED NOT NULL AUTO_INCREMENT; | |
ALTER TABLE TABELA_NOVA ADD FOREIGN KEY (TABELA_RELACIONADA_ID) REFERENCES TABELA_RELACIONADA(ID); | |
-- 4 - O valor do passo 3 mais 1 | |
ALTER TABLE TABELA_NOVA AUTO_INCREMENT = 65536; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.time.LocalDate; | |
import java.time.Month; | |
import java.time.format.DateTimeFormatter; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.TreeMap; | |
import java.util.regex.Matcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.willianantunes.test.routes; | |
import java.time.LocalDateTime; | |
import java.time.ZoneId; | |
import org.apache.camel.LoggingLevel; | |
import org.apache.camel.PropertyInject; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.component.jackson.JacksonDataFormat; | |
import org.apache.camel.component.twitter.TwitterComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.willianantunes.analyser; | |
import java.io.IOException; | |
import java.net.URISyntaxException; | |
import java.nio.file.*; | |
import java.time.LocalDateTime; | |
import java.time.format.DateTimeFormatter; | |
import java.util.*; | |
import java.util.regex.Pattern; | |
import java.util.stream.Collectors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Checks the requests status available in an access.log file and outputs the first 20 lowest responses. | |
# The following pattern is expected: '%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i" %Dms' | |
# Author: Thiago Ferreira (https://github.com/tfc1304) | |
# Example of command to use it: ./check-access-log.sh '/my-path/services/rest/users' '/tmp/access_log.2017-03-03' | |
RED='\033[0;31m' | |
BLUE='\033[1;34m' | |
GREEN='\033[1;32m' | |
YELLOW='\033[1;33m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.willianantunes.utils; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.joda.time.DateTimeConstants; | |
import org.joda.time.LocalDate; | |
/** |