Skip to content

Instantly share code, notes, and snippets.

View vitorebatista's full-sized avatar
🚀
Always innovating

Vitor Emanuel Batista vitorebatista

🚀
Always innovating
View GitHub Profile
@vitorebatista
vitorebatista / mainEx03.c
Last active September 17, 2019 00:34
mainEx03.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "toolsv3.h"
#include "matrizv3.h"
#include "matriz-operacoesv3.h"
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
int main(int argc, char *argv[]) {
@vitorebatista
vitorebatista / download.prw
Last active April 6, 2021 12:12
ADVPL Function to download a file using SOAP or REST api
//---------------------------------------------------------------------
/*/{Protheus.doc} Download
Download de arquivo via HTTP (SOAP, REST)
@since 14/03/2016
@version P12
@return logic
/*/
//---------------------------------------------------------------------
Static Function Download( oWebService, cPath, cFileName )
@vitorebatista
vitorebatista / login.feature
Created May 10, 2019 23:51
BDD - Login example with Cucumber
Feature: Login
I want to login on Keepfy
Background:
Given I go to '/login'
And the field 'email' is empty
And the field 'password' is empty
Scenario: Error on empty fields
@vitorebatista
vitorebatista / MNTFE290.prg
Last active April 9, 2019 14:52
MNTFE290
/*
Exemplo de ponto de entrada do SIGAMNT para cálculo de tempo com base nos insumos de MDO realizado
http://tdn.totvs.com/pages/releaseview.action?pageId=6793663
*/
User Function MNTFE290()
Local cTrb := GetNextAlias()
cQuery := "SELECT SUM(TL_QUANTID) AS TEMPO FROM STLXXX "
cQuery += " INNER JOIN TT7XXX ON TT7_SOLICI = " + ValToSql(TQB->TQB_TQB_SOLICI)
cQuery += " WHERE TL_ORDEM = TT7_ORDEM AND TL_PLANO = TT7_PLANO AND"
@vitorebatista
vitorebatista / IntercomExtensions.kt
Created February 25, 2019 14:28
IntercomExtensions.kt
package br.com.ngi.mnt.services.extensions.trackers
import br.com.ngi.mnt.services.extensions.libs.applyWhen
import br.com.ngi.mnt.sync.model.CurrentBranch
import br.com.ngi.mnt.sync.model.User
import io.intercom.android.sdk.Company
import io.intercom.android.sdk.Intercom
import io.intercom.android.sdk.UserAttributes
import io.intercom.android.sdk.identity.Registration
#include 'hbclass.ch'
#define CRLF Chr( 13 ) + Chr( 10 )
External AllTrim
Class CTE
Hidden:
Data cTable
Data cIdField
User Function TestTarThread()
Local nThread
For nThread := 1 To 2
StartJob('U_TestTar', GetEnvServer(), .F.,)
Next nThread
Return
User Function TestTar()
Local cThreadId := AllTrim( Str( ThreadId() ) )
Local cBarra := If(isSRVunix(),"/","\")
Local cCurDir := CurDir() + If(cBarra $ CurDir(), "" , cBarra )
@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
@vitorebatista
vitorebatista / tstwsrest.prw
Created October 26, 2017 13:03
Exemplo 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