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
function Get-IniContent ($filePath)
{
$ini = @{}
switch -regex -file $FilePath
{
“^\[(.+)\]” # Section
{
$section = $matches[1]
$ini[$section] = @{}
$CommentCount = 0
@danielAlbuquerque
danielAlbuquerque / TFSCommandLineMac.md
Created August 31, 2019 23:49 — forked from chris-pilcher/TFSCommandLineMac.md
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 https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
  • Run:
//----------------------------------------------------
// 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)
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 June 2, 2019 16:34
Upload de arquivo para o protheus_data
#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 January 20, 2019 23:21
Pouch pagination example
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 January 15, 2019 12:47
Exemplo de integracao com a INTELIPOST
#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"
@danielAlbuquerque
danielAlbuquerque / Type with Microphone.py
Created January 11, 2019 19:11 — forked from paulohenriquesn/Type with Microphone.py
Type with Microphone with Python
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 August 3, 2018 18:51
Remove caracteres especiais
#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 June 25, 2018 20:53 — forked from vitorebatista/tstwsrest.prw
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