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
@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 / 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)
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)
//----------------------------------------------------
// 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)
@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:
function Get-IniContent ($filePath)
{
$ini = @{}
switch -regex -file $FilePath
{
“^\[(.+)\]” # Section
{
$section = $matches[1]
$ini[$section] = @{}
$CommentCount = 0