Skip to content

Instantly share code, notes, and snippets.

@dvodvo
dvodvo / gist:f7e3fac76e3db3d4adbc37448a8b709f
Last active April 11, 2022 06:06
multiple database application and i18n with Mobility
Until further notice, i.e. a documented mechanism to run **multiple backend** for an application, the following is a tactical approach to leveraging the Mobility gem.
Motive: consideration of different focus of data - assume global(or central) and local(or decentral) - leads to different polyglot and data requirements locally. One size does not necessarily fit all well.
the key_value backend has its advantages and inconveniences in this context.
*Advantages*
• easily extendible
• good for high volume of translated data
( the other advantages documented here remain true https://dejimata.com/2017/3/3/translating-with-mobility )
*Inconveniences*
• all locale data converges to a single table, which would service the multiple databases of the application
@dvodvo
dvodvo / piano_d_arta.geojson
Created February 14, 2022 10:37
Arta - Piano d'arta
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dvodvo
dvodvo / cabia.geojson
Created February 14, 2022 10:25
arta - cabia
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dvodvo
dvodvo / cedarchis.geojson
Last active February 14, 2022 10:39
Arta - Cedarchis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dvodvo
dvodvo / muggia_ovest.json
Created February 14, 2022 10:14
muggia ovest
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dvodvo
dvodvo / muggia_est.json
Last active February 14, 2022 10:40
muggia est
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dvodvo
dvodvo / muggia_centro.json
Created February 14, 2022 09:07
muggia centro
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dvodvo
dvodvo / gist:9b69f7be345fc13ba2572a0f865097f7
Last active January 20, 2022 10:29
Carrierwave && carrierwave-aws initializer for connecting to DO Spaces
# uploads.rb
CarrierWave.configure do |config|
config.storage = :aws
config.aws_bucket = 'my-bucket-s-name' # name of bucket, no FQDN
config.aws_acl = 'private'
# Optionally define an asset host for configurations that are fronted by a
# content host, such as CloudFront.
# config.asset_host = 'http://example.com'
@dvodvo
dvodvo / gist:9811dc4a0740eac38ba636eac283f736
Last active December 19, 2021 13:28
Stripe authorisation and capture in two steps
def confirm_ts
[...]
else
set_cart_authorisation(@cart)
Stripe.api_key = @cart.shop.private_key
intent = Stripe::PaymentIntent.create({
amount: @authorisation.to_i,
currency: 'eur',
payment_method_types: ['card'],
capture_method: 'manual',