Skip to content

Instantly share code, notes, and snippets.

View jhonata-menezes's full-sized avatar
🏠
Working ...

Jhonata Menezes jhonata-menezes

🏠
Working ...
View GitHub Profile
@jhonata-menezes
jhonata-menezes / launch.json
Created October 23, 2019 14:07
vscode - python
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
package br.gov.sinesp.cidadao.android;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
@jhonata-menezes
jhonata-menezes / instrucoes-ionic4.txt
Created May 22, 2019 19:50
Instruções para compilar o ionic4 com firebase 2019-05-22
#project.properties
cordova.system.library.2=com.google.android.gms:play-services-tagmanager:16+
cordova.system.library.3=com.google.firebase:firebase-core:16.0.8
cordova.system.library.4=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.5=com.google.firebase:firebase-config:16.4.1
cordova.system.library.6=com.google.firebase:firebase-perf:16.2.4
#build.gradle
com.google.gms:google-services:4.1.0
To
@jhonata-menezes
jhonata-menezes / mapping-cep
Last active May 20, 2019 16:09
mapeamento de tipos para as colunas
{
"settings": {
"analysis": {
"analyzer": {
"analyzer_customizado": {
"tokenizer": "standard",
"filter": [
"lowercase",
"stemmer_plural_portugues",
@jhonata-menezes
jhonata-menezes / Exemplo completo
Created May 8, 2019 19:21 — forked from luizgpsantos/Exemplo completo
Analyzer para plural e acentos no elasticsearch
//Cria o índice especificando quais os analyzer ele tem
//Além disso especifica que o campo "titulo" do tipo "seu_tipo" utiliza o analyzer recem criado
curl -XPUT "http://localhost:9200/my_index" -d'
{
"settings": {
"analysis": {
"analyzer": {
"analyzer_customizado": {
"tokenizer": "standard",
@jhonata-menezes
jhonata-menezes / sinesp.go
Created April 19, 2019 20:49
teste com http.client e libcurl
package main
// teste com biblioteca http.client e go-curl
// instalar as seguintes libs
// go get github.com/andelf/go-curl && github.com/mmcloughlin/spherand && go get github.com/parnurzeal/gorequest
// no momento a lib github.com/andelf/go-curl não é compativel com go 1.12, use a 1,11
// necessário ter a libcurl instalada
// o segundo parametro serve para usar com libcurl
// go run sinesp.go aaa0010 1
@jhonata-menezes
jhonata-menezes / http2-apache
Created March 29, 2019 20:28
Habilitando http2 no apache 2.4.29
#este trecho foi retirado do link: https://http2.pro/doc/Apache
#não é possivel usar o http2 com o mod_php necessário utlizar com o fastcgi.
#Caso no necessite utilizar o .htaccess recomendo usar o nginx como servidor web
#Testado com o Ubuntu 18.04.2 e apache2.4.29
apachectl stop
apt-get install php7.1-fpm # Utilizar a versão conforme sua instalação.
a2enmod proxy_fcgi setenvif
a2enconf php7.2-fpm
a2dismod php7.2
package config
import (
"fmt"
"github.com/crgimenes/goconfig"
_ "github.com/crgimenes/goconfig/yaml"
"log"
"os"
"path/filepath"
)
version: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(asctime)s - %(filename)s - %(levelname)s - %(message)s"
handlers:
console:
class: logging.StreamHandler
level: INFO
@jhonata-menezes
jhonata-menezes / virtualhost
Created May 3, 2018 22:12
virtual host para o nginx
server {
server_name localhost;
root /var/www/html;
location = / {
try_files @site @site;
}
location / {
try_files $uri $uri/ @site;