Skip to content

Instantly share code, notes, and snippets.

Working from home

Daniel Albuquerque danielAlbuquerque

Working from home
Block or report user

Report or block danielAlbuquerque

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
danielAlbuquerque /
Created Aug 31, 2019 — forked from chris-pilcher/
Using TFS Online TFVC with command-line TFS utility on Mac

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" < /dev/null 2> /dev/null
  • Run:
View main.prw
// Verifico a necessidade de criar/atualizar cliente
SA1->( dbSetOrder(3) )
lInsere := !SA1->( MsSeek( xFilial('SA1') + oPedido['cliente']['cpf_cnpj'] ) )
nRec := ::updCustomer(lInsere, oPedido)
View gist:3ae8a85236be9e83cd0d659ee89b80d2
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)
danielAlbuquerque / zUpload.prw
Last active Jun 2, 2019
Upload de arquivo para o protheus_data
View zUpload.prw
#include ''
User Function zUpload(cUploadDir)
Local cArq := cGetFile('Arquivo *|*.*','Todos os Drives',0,'C:\Dir\',.T.,GETF_LOCALHARD,.T.)
Default cUploadDir := "\uploads\"
If !Empty( cArq )
If !ExistDir( cUploadDir ); MakeDir( cUploadDir ); EndIf;
If CpyT2S(cArq, cUploadDir)
danielAlbuquerque / index.js
Created Jan 20, 2019
Pouch pagination example
View index.js
const pouchDB = require('pouchdb-node')
const db = new pouchDB('database_name')
let options = { limit: 5 }
async function fetchNextPage () {
try {
const result = await db.allDocs(options)
if (result.rows.length > 0) {
danielAlbuquerque / Intel01tst.prw
Created Jan 15, 2019
Exemplo de integracao com a INTELIPOST
View Intel01tst.prw
#include ''
#include "TBICONN.CH"
User Function Intel01tst()
Local oPedidoEnvio, cPed, oVolume
Local aItens := {}
cPed := "000131"
View Type with
import speech_recognition as sr
from pyautogui import press, typewrite, hotkey
r = sr.Recognizer()
with sr.Microphone() as source:
while True:
audio = r.listen(source)
result = r.recognize_google(audio,language="pt-BR")
danielAlbuquerque / RemoveEspec.prw
Created Aug 3, 2018
Remove caracteres especiais
View RemoveEspec.prw
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,"*","")
danielAlbuquerque / tstwsrest.prw
Created Jun 25, 2018 — forked from vitorebatista/tstwsrest.prw
Exemplo completo webservice REST ADVPL
View tstwsrest.prw
#include ""
#include ""
#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
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))
You can’t perform that action at this time.