Skip to content

Instantly share code, notes, and snippets.

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

Alex Ishida alexishida

👨‍💻
Coding
View GitHub Profile
@oliveira-andre
oliveira-andre / rails_6_notations.md
Last active December 2, 2019 13:36
rails 6 annotations

coffee and jquery

  • Coffee and another gems like jquery is installed on yarn and imported on app/javascripts/application.js

    rails webpacker:install:coffee

    References

@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 / comandos-ruby-rails-exemplos.txt
Last active February 24, 2025 13:39
Comandos Ruby e Rails
# Removendo o carregamento onhover de links
<meta name="turbo-prefetch" content="false">
# Method Delete link_to no turbo
<%= link_to logout_path, class: "nav-link", data: { turbo_method: :delete, turbo: true } do %>
# COMANDOS
rails new appname -d postgresql
rails new appname --api
@alexishida
alexishida / rbenv-ruby-rails-install.sh
Last active January 2, 2025 13:48
Script to install rbenv, Ruby, nodejs and yarn
#!/bin/bash
#---------------------------------------------------------------------------------------
# Script to install rbenv, Ruby, nodejs and yarn
# Source: https://gist.github.com/alexishida/655fb139c759393ae5fe47dacd163f99
#
# Author: Alex Ishida <[email protected]>
# Version: 1.7.0 - 02/01/2025
#---------------------------------------------------------------------------------------
#
# HOW TO INSTALL A SCRIPT
@0mkara
0mkara / Ethereum_private_network.md
Last active March 30, 2025 21:48
Ethereum private network configuration guide.

Create your own Ethereum private network

Introduction

Used nodes:

Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
Linux localhost.localdomain 4.14.5-200.fc26.x86_64 #1 SMP Mon Dec 11 16:29:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@mrbongiolo
mrbongiolo / precompile.md
Last active February 27, 2023 00:16
HOW TO: Rails 4.2 add 'vendor/asset' to precompile list

To enable the precompilation of all non.js/.css assets within vendor/assets just add this to config/initializers/assets.rb:

Rails.application.config.assets.precompile << Proc.new { |path, fn| fn =~ /vendor\/assets/ && !%w(.js .css).include?(File.extname(path)) }

Be aware that this will precompile ALL non .js/.css assets that you have there, some plugins or libraries might have .txt or other files around, and those would end up into your precompiled list also.

If you need to precompile images only, you could use this:

Rails.application.config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)