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
danielAlbuquerque / TFSCommandLineMac.md
Created Aug 31, 2019 — forked from chris-pilcher/TFSCommandLineMac.md
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:
View main.prw
//----------------------------------------------------
// Verifico a necessidade de criar/atualizar cliente
//----------------------------------------------------
dbSelectArea("SA1")
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
danielAlbuquerque / zUpload.prw
Last active Jun 2, 2019
Upload de arquivo para o protheus_data
View zUpload.prw
#include 'totvs.ch'
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
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)
console.log(result.rows)
if (result.rows.length > 0) {
@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"
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 / 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,"*","")
@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
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.