Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Daniel Albuquerque danielAlbuquerque

🏠
Working from home
  • ERPSERV
  • Macapá
View GitHub Profile
View Upload.prw
#Include "protheus.ch"
#Include "restful.ch"
WSRestFul XXXXXXXXXX Description "Serviço REST para tratar os arquivos de anexo da visita"
WSMethod POST Description "Dados dos arquivos enviados" WSSyntax "/xxxxxxx" PATH "/xxxxxxx" CONSUMES MULTIPART_FORM_DATA PRODUCES APPLICATION_JSON
End WSRestFul
//Só não foi tratado o envio de múltiplos arquivos em um post só, mas no portinari mesmo anexando vários arquivos, ele faz 1 post para cada um.
@aedorado
aedorado / docker-compose.yml
Created Dec 6, 2020
Docker compose file for ELK 7.9.2
View docker-compose.yml
version: '3.7'
services:
elasticsearch:
image: elasticsearch:7.9.2
ports:
- '9200:9200'
environment:
- discovery.type=single-node
ulimits:
@CHERTS
CHERTS / zabbix_selinux_centos8_config.txt
Last active May 18, 2022
Zabbix on CentOS 8 with SELinux
View zabbix_selinux_centos8_config.txt
If you're running the Zabbix on CentOS 8 with SELinux enabled on it, then you must do all command on this section.
Install SELinux utilities using the dnf command below.
dnf install policycoreutils checkpolicy setroubleshoot-server
Once the installation is complete, create a new directory '~/zabbix-linux' and go into it.
mkdir -p ~/zabbix-selinux
cd ~/zabbix-selinux/
@Dadinel
Dadinel / Dnl_FWTemporaryTable.prw
Last active Jun 24, 2021
Exemplo de utilização comentado da FWTemporaryTable, classe que possibilidade a criação de tabelas temporárias no banco de dados
View Dnl_FWTemporaryTable.prw
#include "protheus.ch"
user function DnlTmpTbl()
local oTable as object
local aFields as array
local nConnect as numeric
local lCloseConnect as logical
local cAlias as char
local cTableName as char
local cAreaQuery as char
@jjvillavicencio
jjvillavicencio / setup.sh
Last active Sep 25, 2022
Install Android SDK on Windows Bash (WSL)
View setup.sh
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@Toilal
Toilal / api.module.ts
Last active May 14, 2021
@auth0/angular2-jwt Authorization Service and HttpInterceptor supporting JWT Refresh Token (Angular 4.3+ & 5+)
View api.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { JWT_OPTIONS, JwtInterceptor, JwtModule } from '@auth0/angular-jwt';
import { AuthorizationService } from './authorization.service';
import { environment } from '../../environments/environment';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { RefreshTokenInterceptor } from './refresh-token-interceptor';
function jwtOptionsFactory (authorizationService: AuthorizationService) {
return {
@vitorebatista
vitorebatista / tstwsrest.prw
Last active May 18, 2022
Exemplo completo webservice REST ADVPL
View tstwsrest.prw
#include "PROTHEUS.ch"
#include "RESTFUL.ch"
#xtranslate @{Header <(cName)>} => ::GetHeader( <(cName)> )
#xtranslate @{Param <n>} => ::aURLParms\[ <n> \]
#xtranslate @{EndRoute} => EndCase
#xtranslate @{Route} => Do Case
#xtranslate @{When <path>} => Case NGIsRoute( ::aURLParms, <path> )
#xtranslate @{Default} => Otherwise
@dublado
dublado / gist:f584cdd895eb6db0b74c199d532d2ac8
Created May 25, 2017
Nomes das Tabelas do Protheus/TOTVS
View gist:f584cdd895eb6db0b74c199d532d2ac8
Nomes das Tabelas
SX1 Manutenção de Perguntas de parametrização (movimentações, consultas e relatórios)
SX2 Manutenção dos Arquivos
SX3 Manutenção dos Campos
SX4 Configuração de Agenda de Relatórios e Processos
SX5 Manutenção de Tabelas
SX6 Manutenção de Parâmetros
SX7 Manutenção de Gatilhos de Campos (SX3)
SX9 Manutenção de Relacionamento entre Arquivos (SX2)
SXA Manutenção de Pastas Cadastrais dos Arquivos (SX2)
@spalladino
spalladino / mysql-docker.sh
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@chris-pilcher
chris-pilcher / TFSCommandLineMac.md
Last active Aug 3, 2021
Using TFS Online TFVC with command-line TFS utility on Mac
View TFSCommandLineMac.md

Install Command-Line TFS using HomeBrew on a Mac

Install Team Explorer Everywhere Command Line Client

  • Press Command+Space and type Terminal and press enter/return key.
  • Install HomeBrew by running command in Terminal app
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
  • Run: