Skip to content

Instantly share code, notes, and snippets.

View fabiob's full-sized avatar

Fábio D. Batista fabiob

View GitHub Profile
@fabiob
fabiob / save-sqs-queue.py
Last active January 5, 2024 07:05 — forked from kern/save-sqs-queue.py
Saves all messages from an AWS SQS queue into a folder
#!/usr/bin/env python3
import argparse
import boto3
import json
import os
from datetime import datetime
parser = argparse.ArgumentParser(
description='Saves all messages from an AWS SQS queue into a folder.')
@fabiob
fabiob / sync.ps1
Created November 25, 2019 19:15 — forked from saymont/sync.ps1
Script para sincronização de documentos com o Portal Consyst-e
###############################################################################
# Script para sincronização de documentos com o Portal Consyst-e
# Documentação da integração: https://portal.consyste.com.br/doc/api
###############################################################################
param (
[Parameter(Mandatory=$true)][string]$AuthToken, # o token de autenticação no Consyst-e
[string]$OutDir = '/tmp/csv', # o diretório onde o CSV será salvo
[string]$Kind = 'nfe', # o tipo de documento a consultar ('nfe' ou 'cte')
[string]$Query = 'recebido_em: [now-30d TO *]' # consulta a rodar

Keybase proof

I hereby claim:

  • I am fabiob on github.
  • I am fabiob (https://keybase.io/fabiob) on keybase.
  • I have a public key ASCLCJ-G3_9A8a37rtzxsgVvJKRtd-I6XL-xgByBEqXcUQo

To claim this, I am signing this object:

@fabiob
fabiob / bin-test.spec.ts
Created September 10, 2017 02:20
Testing binary downloads using chai-http
import 'mocha';
import { expect, request } from 'chai';
import chaiHttp = require('chai-http');
import { app } from '../../server';
chai.use(chaiHttp);
const BIN_FILE = new Buffer([
0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
gem 'mongo', '2.2.4' # this version raises "Cursor not found"
# gem 'mongo', '2.1.2' # this version works
require 'uri'
require 'mongo'
puts "-" * 50
puts "Mongo Driver version: #{Mongo::VERSION}"
puts "-" * 50
@fabiob
fabiob / order_19.json
Last active October 2, 2015 20:10 — forked from zekisan/order_19.json
{"error":
{"suppliers": [
{"56625272428085":
{"registration_municipal":["n\xC3\xA3o pode ficar em branco"
],
"registration_state":["n\xC3\xA3o pode ficar em branco"],
"main_phone.ddd":["n\xC3\xA3o \xC3\xA9 v\xC3\xA1lido"],
"main_phone.number":["n\xC3\xA3o \xC3\xA9 v\xC3\xA1lido"],
"main_phone.contact_name":["n\xC3\xA3o pode ficar em branco"]}}],
"order_items":[
module ThreadSafeLoggerSilence
extend ActiveSupport::Concern
included do
alias_method_chain :level, :threadsafety
alias_method_chain :add, :threadsafety
end
def thread_level
Thread.current[:logger_level]
var https = require('https'); // usar HTTPS ao invés de HTTP
var options = {
host: 'portal.consyste.com.br',
path: '/ws/cdlrio/contas',
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Consyste-Auth-Token': 'tey5CKdSrXtzr3pcc7fH' }
};
var postData = {
class PivotTable
attr_accessor :table, :totals, :grand_total, :pivot_values
def initialize(options)
@data = options[:data]
@row_fields = options[:row_fields].to_a
@data_field = options[:data_field]
@pivot_field = options[:pivot_field]
@pivot_values = options[:pivot_values]