Skip to content

Instantly share code, notes, and snippets.

View abacha's full-sized avatar

Adriano Bacha abacha

  • São Paulo, SP
  • 23:20 (UTC -03:00)
View GitHub Profile
class Empresa
has_one "matriz", class: Empresa
has_one "filial", class: Empresa
end
@abacha
abacha / gist:6645699
Last active December 23, 2015 13:59
def reduce(arr, amount)
sample = []
ratio = (arr.count / amount).floor
while sample.count < amount
index = sample.count
inf = index * ratio
sup = (index + 1) * ratio - 1.0
sum = arr[inf..sup].reduce(:+)
sample << sum / sup - inf + 1.0
end
Outbound Message
---------------------------
ID: 1
Address: https://ws.producao.sistemagalgo:7843/ServicePLCota
Encoding: UTF-8
Http-Method: POST
14:24:56,521 DEBUG PLCotaUI.btnConsumirActionPerformed():329 - Botão consumir acionado
14:24:56,521 DEBUG PLCotaUI.validateteFields():485 - login=WEBSERVICE.SIMPLIFICPAVARINI
14:24:56,521 DEBUG Config.saveProps():142 - Salvando as configurações em C:\Users\adriano\.plcota\config.properties
14:24:56,521 DEBUG Config.saveProps():142 - Salvando as configurações em C:\Users\adriano\.plcota\config.properties
14:24:56,521 DEBUG PLCotaUI.btnConsumirActionPerformed():344 - dtIni=Thu Aug 08 00:00:00 BRT 2013; dtFin=Wed Aug 14 00:00:00 BRT 2013
14:24:56,537 DEBUG PLCotaUI.doInBackground():571 - Cursor Ampulheta
14:24:56,537 INFO PLCotaUI.doInBackground():585 - Recuperando PL Cota para 1 fundos
14:24:59,426 DEBUG PLCotaUI.doInBackground():588 - Pasta selecionada: C:\Users\adriano\Desktop
14:24:59,426 DEBUG Config.addProperty():132 - Incluindo propriedade: xml.last_save.path=C:\Users\adriano\Desktop
14:24:59,426 DEBUG Config.saveProps():142 - Salvando as configurações em C:\Users\adriano\.plcota\config.properties
http://u761560.sendgrid.org/wf/click?upn=tDF5W1uBIWLOynnRXM9V4d-2BwPlK8sIQjYqr505GtgIMc5HEsNeblGvFqh49nzuLeArSpMEgf4a9b1d7kNmsTpQ-3D-3D_lCiRXtk4rsq01TOdyw27Slu8GUEtFh-2FOQwDu67Xu9Hbl68uWVIEUtjYLItZ8-2FZ81JZx5QrmhiMKuthJ0KISOqlGwbDQzMvpYsvreN-2F75nnH7AOzT-2B-2BTv8R2MwFqZDqe6seY-2BYMWnHqAOSwi4Q-2BPXoCZkUuKchYdFmwve6O6eP2gn2yfiYJenu0b2u7L6XcMqsAR-2Fz275GXujfinPBmzLZLXGQ-2B4YHH5ijX63-2FId0tP8UAis6oHrH5-2Bf7VfsV2Y6DFvvvWCzWVLhhCeNpwRUHJnGF3gy6Mxmuls56DC0Q2cOfebqnbrsxb1dSm5Y2D0ppFq2-2BC7da216pisSWWh-2F-2FzfYB6mds6PhQjRzgpm7XKmx1-2B2-2BXWNQ-2FcpgJYB4qTOiSx6Wjhi8e-2BY9UJTC1LRlc46zUVOZW0eDXcaiOz0DrKEyZUMHq-2Fgg78Nv27h9NvL-2F9RRIiuPZB7fLvwxce5QKNetyNUYWFnLaKrABVGnQdDbc3vuGlcHGJ29WQdf8q2uKZhoSea3NiHRz-2FrLd6bIX4sEg84U9W2r05-2BvFjD5ED-2BkkzZgQC1GRB91dgkYGywCW-2BY1G2zSiCR46Sksm7dhGEQtB0-2FBJT1i9tdkdNxblvw0z-2BrR7PUUqwhcYt6FT7XBAEEsQUncLsLgRAxUkzk023iCk6NZK7AErLW1AqAN1HInDIXhXrFmR0fDMOSXIHB-2Fj3cBJD8RUK9CM-2FiaQftXVA5mtzWqI17cKdBzanDPvg31NwNJ9IhBPXOWMCi3-2BlhwqNVOGlvYQo4V-2FnZk4M7hR-2B4SudVadprAz9H4Zws9UHlb3X55NtlUflhMqz-2
wget errbit.simplificpavarini.com.br:5000
--2013-04-21 17:28:44-- http://errbit.simplificpavarini.com.br:5000/
Resolving errbit.simplificpavarini.com.br (errbit.simplificpavarini.com.br)... 127.0.0.1
Connecting to errbit.simplificpavarini.com.br (errbit.simplificpavarini.com.br)|127.0.0.1|:5000... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://errbit.simplificpavarini.com.br:5000/users/sign_in [following]
--2013-04-21 17:28:45-- http://errbit.simplificpavarini.com.br:5000/users/sign_in
Reusing existing connection to errbit.simplificpavarini.com.br:5000.
@abacha
abacha / index.js.coffee
Created April 11, 2013 12:59
app/assets/javascripts/fund/index.js.coffee
window.FundIndex = {}
FundIndex.document_ready = ->
< ... >
factory :user do
sequence(:email) { |n| "user#{n}@mail.com" }
password "password"
ignore do
role "Client"
end
after(:build) do |user, e|
user.roles = [Role.new(:name => e.role)]
end
end
factory :portfolio_request do
account
association :owner, factory: :user
comments "portfolio example"
end
factory :historic_balance do
fund
account
date "2013-03-05"
amount 1000
end