Skip to content

Instantly share code, notes, and snippets.

View ldlsegovia's full-sized avatar

Leandro Segovia ldlsegovia

View GitHub Profile
@ldlsegovia
ldlsegovia / capybara cheat sheet
Created July 30, 2017 00:26 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@ldlsegovia
ldlsegovia / PDFtk.md
Last active February 18, 2018 16:21 — forked from jvenator/gist:9672772a631c117da151
PDFtk Server Install Workaround for Mac OS X

Installing PDFtk Server edittion on your Mac

This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
All Terminal commands separated by a full line space. Some commands wrap into multiple lines.

Download and extract the Mac OS X server install pacakge

ENV['RAILS_ENV'] = ARGV[0] || 'production'
DIR = File.dirname(__FILE__)
require DIR + '/config/environment'
Migration::FillDemoPriceChanges.for
@ldlsegovia
ldlsegovia / requerimientos-api-sii.md
Last active August 19, 2019 15:41
Requerimientos API Rest SII

API Rest SII

Crear sociedades

Endpoint:

POST /tax-accounts

Atributos en el body:

Me imagino algo así:

Ledgerizer.setup do |conf|
  conf.tenant(:subsidiary, currency: :clp) do
    conf.liability :user_funds_custody, currencies: [:clp, :btc] # estas son las currencies que acepta la cuenta
    conf.asset :user_funds_to_confirm, currencies: [:clp, :btc]

    conf.entry :user_deposit, document: :ledger_line do
      conf.debit account: :user_funds_to_confirm, accountable: :account

Rails Modular

Ventajas:

  • Se puede cooperar sin miedo a tocar algo de otro engine.
  • Acotar los features/problemas. No es necesario lidiar con toda la complejidad de la app. Motivo principal por el que vamos a modularizar yo creo.
  • Los tests puede correr isolated.

Desventajas:

@ldlsegovia
ldlsegovia / engines.md
Created August 19, 2021 18:58
Rails engines/gems modularización

Modularización

Para modularizar el monolito, estamos usando engines de Rails.

Generador

Para facilitar la tarea de crear nuevos engines y gemas, usamos Gemaker de la siguiente manera:

bin/gemaker new nombre_engine