Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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

Daniel Albuquerque danielAlbuquerque

🏠
Working from home
  • BiziFy
  • São Paulo
View GitHub Profile
#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 December 6, 2020 16:24
Docker compose file for ELK 7.9.2
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 October 21, 2022 23:23
Zabbix on CentOS 8 with SELinux
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 November 10, 2022 12:55
Exemplo de utilização comentado da FWTemporaryTable, classe que possibilidade a criação de tabelas temporárias no banco de dados
#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 April 22, 2024 21:22
Install Android SDK on Windows Bash (WSL)
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 February 21, 2023 10:30
@auth0/angular2-jwt Authorization Service and HttpInterceptor supporting JWT Refresh Token (Angular 4.3+ & 5+)
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 March 20, 2024 02:13
Exemplo completo webservice REST ADVPL
#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
@SKempin
SKempin / Git Subtree basics.md
Last active April 17, 2024 03:47
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@dublado
dublado / gist:f584cdd895eb6db0b74c199d532d2ac8
Created May 25, 2017 21:33
Nomes das Tabelas do Protheus/TOTVS
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 December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# 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