Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Daniel Albuquerque danielAlbuquerque

🏠
Working from home
  • ERPSERV
  • Macapá
View GitHub Profile
@danielAlbuquerque
danielAlbuquerque / GTFROTA.cs
Last active Aug 27, 2015
Exception on Connect
View GTFROTA.cs
static void Main(string[] args)
{
try{
GTFrotaIntegracaoClient client = new GTFrotaIntegracaoClient();
if (client.Autenticar("JSANTANA", "123"))
Console.WriteLine("Acesso autorizado");
else
Console.WriteLine("ACesso negado");
}catch(Exception ex){
Console.WriteLine(ex.Message);
View kannel
#CORE
group = core
admin-port = 13000
admin-password = playsms
status-password = playsms
log-file = "/var/log/kannel/kannel.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
smsbox-port = 13001
store-type = file
@danielAlbuquerque
danielAlbuquerque / google_drive_util.py
Created Feb 6, 2017 — forked from macieksk/google_drive_util.py
A simple Python module to upload files to Google Drive file upload. Needs a file 'client_secrets.json' in the directory . The file can be obtained from https://console.developers.google.com/ -- under APIs&Auth/Credentials/Create Client ID for native application
View google_drive_util.py
## Simple Python module to upload files to Google Drive
# Needs a file 'client_secrets.json' in the directory
# The file can be obtained from https://console.developers.google.com/
# under APIs&Auth/Credentials/Create Client ID for native application
# To test usage:
# import google_drive_util
# google_drive_util.login()
# google_drive_util.test()
View metodos.js
generatePagesArray: function(currentPage, collectionLength, rowsPerPage, paginationRange)
{
var pages = [];
var totalPages = Math.ceil(collectionLength / rowsPerPage);
var halfWay = Math.ceil(paginationRange / 2);
var position;
if (currentPage <= halfWay) {
position = 'start';
} else if (totalPages - halfWay < currentPage) {
@danielAlbuquerque
danielAlbuquerque / reportSample.prw
Created Mar 13, 2017
Exemplo de relatório em ADVPL
View reportSample.prw
#INCLUDE 'protheus.ch'
#INCLUDE 'topconn.ch'
User Function ImpGTRel01()
Private oReport := Nil
Private oSecCab := Nil
Private cPerg := PadR("RCOMR01", Len(SX1->X1_GRUPO))
PutSx1(cPerg,"01","Código de?" ,'','',"mv_ch1","C",TamSx3 ("B1_COD")[1] ,0,,"G","","SB1","","","mv_par01","","","","","","","","","","","","","","","","")
PutSx1(cPerg,"02","Código ate?" ,'','',"mv_ch2","C",TamSx3 ("B1_COD")[1] ,0,,"G","","SB1","","","mv_par02","","","","","","","","","","","","","","","","")
View FreespaceTableSpace.SQL
col "Tablespace" for a22
col "Used MB" for 99,999,999
col "Free MB" for 99,999,999
col "Total MB" for 99,999,999
select df.tablespace_name "Tablespace",
totalusedspace "Used MB",
(df.totalspace - tu.totalusedspace) "Free MB",
df.totalspace "Total MB",
round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace))
@danielAlbuquerque
danielAlbuquerque / tstwsrest.prw
Created Jun 25, 2018 — forked from vitorebatista/tstwsrest.prw
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
@danielAlbuquerque
danielAlbuquerque / RemoveEspec.prw
Created Aug 3, 2018
Remove caracteres especiais
View RemoveEspec.prw
#INCLUDE "TOTVS.CH"
User Function RemoveEspec(cWord)
cWord := OemToAnsi(AllTrim(cWord))
cWord := FwNoAccent(cWord)
cWord := FwCutOff(cWord)
cWord := strtran(cWord,"ã","a")
cWord := strtran(cWord,"º","")
cWord := strtran(cWord,"%","")
cWord := strtran(cWord,"*","")
View Type with Microphone.py
import speech_recognition as sr
from pyautogui import press, typewrite, hotkey
r = sr.Recognizer()
with sr.Microphone() as source:
while True:
try:
audio = r.listen(source)
result = r.recognize_google(audio,language="pt-BR")
@danielAlbuquerque
danielAlbuquerque / Intel01tst.prw
Created Jan 15, 2019
Exemplo de integracao com a INTELIPOST
View Intel01tst.prw
#include 'totvs.ch'
#include "TBICONN.CH"
// EXEMPLO DE CHAMADA DA FUNCAO
User Function Intel01tst()
Local oPedidoEnvio, cPed, oVolume
Local aItens := {}
PREPARE ENVIRONMENT EMPRESA "01" FILIAL "0103" USER "ADMIN" PASSWORD "589@corp" MODULO "FAT"
cPed := "000131"