Skip to content

Instantly share code, notes, and snippets.

View alexishida's full-sized avatar
👨‍💻
Coding

Alex Ishida alexishida

👨‍💻
Coding
View GitHub Profile
@alexishida
alexishida / inflections.rb
Last active September 14, 2022 19:19
Rails Inflections PT-BR
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
ActiveSupport::Inflector.inflections do |inflect|
inflect.clear
@alexishida
alexishida / rails-pt-br-internacionalizacao.txt
Last active December 16, 2024 18:19
Internacionalizacao Rails para pt-BR locale i18n
# Artigo ogirinal por JORGE VILAÇA
# https://jorgevilaca.wordpress.com/2012/03/06/nacionalizando-rails-para-pt-br/
# config/application.rb
config.i18n.default_locale = :'pt-BR' # Define o locale padrão como pt-BR
config.i18n.available_locales = ['en', :'pt-BR'] # Adiciona pt-BR aos locais disponíveis
config.time_zone = 'La Paz'
config.active_record.default_timezone = :local
@alexishida
alexishida / pt-BR.yml
Last active May 31, 2023 16:11
Rails Locale pt-BR
pt-BR:
activerecord:
errors:
messages:
record_invalid: 'A validação falhou: %{errors}'
restrict_dependent_destroy:
has_one: Não é possível excluir o registro pois existe um %{record} dependente
has_many: Não é possível excluir o registro pois existem %{record} dependentes
date:
abbr_day_names:
@alexishida
alexishida / postfix-foward-email.txt
Created July 6, 2018 15:51
Configure POSTFIX to foward email
sudo apt-get install postfix
sudo pico /etc/postfix/main.cf
# Remove $myhostname
#mydestination = $myhostname
@alexishida
alexishida / credentials-commands.txt
Last active November 13, 2023 16:14
Rails 5.2 Credentials Secrets
# Edit credentials
EDITOR=nano rails credentials:edit
# Generate Random key
rails secret
# Use Example on Devise
development:
@alexishida
alexishida / webdev_online_resources.md
Created July 17, 2018 03:55 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@alexishida
alexishida / simple_form.pt-BR.yml
Created August 2, 2018 12:55
simple-form em pt-BR
pt-BR:
simple_form:
"yes": 'Sim'
"no": 'Não'
required:
text: 'necessário'
mark: '*'
# You can uncomment the line below if you need to overwrite the whole required html.
# When using html, text and mark won't be used.
# html: '<abbr title="required">*</abbr>'
@alexishida
alexishida / enable rc.local.txt
Created September 6, 2018 12:32
Enable / Create rc.local
sudo systemctl status rc-local
sudo systemctl enable rc-local
sudo nano /etc/systemd/system/rc-local.service
####### Copie os dados a baixo #####
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
@alexishida
alexishida / change sass to sassc.txt
Last active November 20, 2018 01:53
Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.
Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
http://sass.logdown.com/posts/7081811
@alexishida
alexishida / config-assets-js-css-turbolinks-rails.txt
Last active June 8, 2020 21:27
Config de Assets Javascript Vendor Turbolinks no Rails