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
//<dependency> | |
//<groupId>com.fasterxml.jackson.core</groupId> | |
//<artifactId>jackson-databind</artifactId> | |
//<version>2.13.0-rc1</version> | |
//</dependency> | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.JsonMappingException; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; |
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 subprocess | |
args = ['C:\\Program Files\\Mozilla Firefox\\firefox.exe', 'google.com'] | |
subprocess.call(args) |
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
@app.route('/ceps/xml/') | |
def baixarCepsXML(): | |
xml_base = dicttoxml(db_cep_json) | |
xml_base_str = xml.dom.minidom.parseString(str(xml_base)) | |
xml_pretty = xml_base_str.toprettyxml() | |
return Response(xml_pretty, mimetype='application/xml') | |
#return xml |
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 requests | |
import sys | |
import json | |
def waybackurls(host, with_subs): | |
if with_subs: | |
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host | |
else: | |
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host |
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
FROM python:2.7 | |
#define o python que será utilizado | |
COPY ./ /usr/src/app | |
WORKDIR /usr/src/app | |
RUN pip install flask | |
#instala o flask | |
RUN pip install elastic-apm[flask] | |
#instalar o apm agent | |
CMD ["python", "simples.py"] | |
#inicia o servidor |
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
from flask import Flask | |
from elasticapm.contrib.flask import ElasticAPM | |
from elasticapm.handlers.logging import LoggingHandler | |
import time | |
import os | |
#importacao de bibliotecas | |
app = Flask(__name__) | |
#intancia o flask |
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
version: '3' | |
services: | |
apm-server: | |
#define as configuracoes do servidor apm (igual a documentacao oficial) | |
image: docker.elastic.co/apm/apm-server:7.6.1 | |
#link da imagem docker que sera baixado | |
depends_on: | |
- elasticsearch |
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 pacote; | |
import java.io.File; | |
public class ClasseMain { | |
public static void adicionarNoBanco(String pathArquivo) { | |
System.out.println(pathArquivo); | |
//merge e commit | |
} |
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
#regex de string | |
def get_string(variavel, inicio, fim): | |
variavel_array_primario = variavel.split(inicio) | |
variavel_array_secundario = variavel_array_primario[1].split(fim) | |
resultado = variavel_array_secundario[0] | |
return resultado | |
frase = "GitHub brings together the world's largest community of developers to discover, share, and build better software" | |
frase_filtrada = get_string(frase, 'together', 'to') |
NewerOlder