This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IDEA FROM: https://stackoverflow.com/questions/33929712/crypto-in-nodejs-and-ruby | |
var crypto = require('crypto'), | |
algorithm = 'aes-256-cbc', | |
key = 'SOME_RANDOM_KEY_32_CHR_123456789', // 32 Characters | |
iv = "0000000000000000"; // 16 Characters | |
function encrypt(text){ | |
var cipher = crypto.createCipheriv(algorithm,key,iv) | |
var crypted = cipher.update(text,'utf-8',"base64") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple form | |
config.wrappers :totem_radio_and_checkboxes, tag: :fieldset, class: '', :error_class => 'error' do |b| | |
b.use :html5 | |
b.use :label, class: 'font-medium text-lg mb-1' | |
b.wrapper :tag => 'div', :class => 'mt-1' do |ba| | |
ba.use :input, :class => 'input_radio_checkbox' | |
end | |
b.use :hint, wrap_with: { tag: :p } | |
b.use :error, wrap_with: { tag: :p, class: 'text-red-600' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
file = CSV.read('arq.csv', headers: true, col_sep: ';') | |
stocks = file['Produto'].uniq.sort | |
receives = { | |
'dividendo': [], | |
'jcp': [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# translations for rails_admin | |
pt-BR: | |
datetime: | |
distance_in_words: | |
x_days: | |
one: "1 dias" | |
other: "%{count} dias" | |
activerecord: | |
models: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.7.2 | |
RUN apt-get update -yqq && apt-get install -y build-essential libpq-dev nodejs | |
## install yarn | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | |
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | |
&& apt-get update && apt-get install -y yarn && rm -rf /var/lib/apt/lists/* | |
RUN mkdir /myapp |