Skip to content

Instantly share code, notes, and snippets.

# COMANDOS
rails new appname -d postgresql
rails new appname --api
gem install rails -v 6.1.4.4
rails _6.1.4.4_ new myapp
# Rails sem webpack
rails new app-name --skip-webpack-install --skip-javascript
@alexishida
alexishida / pancake_lottery.rb
Last active March 22, 2022 11:51
PancakeSwap Lottery Odds preview
# frozen_string_literal: true
#!/usr/bin/ruby
require 'securerandom'
numero_sorteado = "781040"
rodadas = 0
acerto_1 = false
@alexishida
alexishida / programacao-ruby-avancada.md
Last active August 13, 2022 13:03
Programação Ruby Avançada
@alexishida
alexishida / Rails Oracle Client 21 Linux
Last active November 18, 2025 17:17
Rails Oracle Client 21 Linux
# Version 21.6.0.0.0 (Requires glibc 2.14)
# Instalar a biblioteca (http://mirrors.kernel.org/ubuntu/pool/main/liba/libaio/libaio1_0.3.113-5_amd64.deb)
# sudo apt-get install libaio1 libaio-dev unzip
sudo apt-get install libaio1t64
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
# Criar a pasta
sudo mkdir /opt/oracle
@alexishida
alexishida / rails-oracle-client-19-linux.txt
Last active December 16, 2022 12:21
Rails Oracle Client 19 Linux
# Version 19.11.0.0.0
# Instalar a biblioteca
sudo apt-get install libaio1
# Criar a pasta
sudo mkdir /opt/oracle
# Mover para /opt/oracle
instantclient-basic-linux.x64-19.11.0.0.0dbru.zip
instantclient-sdk-linux.x64-19.11.0.0.0dbru.zip
@alexishida
alexishida / rbenv-ruby-rails-update.sh
Last active October 18, 2025 00:36
Script to update rbenv, Ruby and Ruby on Rails versions
#!/bin/bash
#---------------------------------------------------------------------------------------
# Script to update rbenv, Ruby and Ruby on Rails versions
# Source: https://gist.github.com/alexishida/015b074ae54e1c7101335a2a63518924
#
# Author: Alex Ishida <alexishida@gmail.com>
# Version: 1.7.2 - 17/10/2025
#---------------------------------------------------------------------------------------
#
# If you want install rbenv for the first time
@raineorshine
raineorshine / sendRawTransaction.js
Last active December 3, 2022 18:02
Sends a raw transaction with web3 v1.2.2, ethereumjs-tx v2.1.1, and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privateKey = new Buffer('PRIVATE_KEY', 'hex')
@alexishida
alexishida / rbenv-ruby-rails-install.sh
Last active October 22, 2025 00:09
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 <alexishida@gmail.com>
# Version: 1.7.3 - 21/10/2025
#---------------------------------------------------------------------------------------
#
# HOW TO INSTALL A SCRIPT